Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,odoo12 菜单显示不了, #1

Open
mylovetop opened this issue Jan 1, 2020 · 0 comments
Open

你好,odoo12 菜单显示不了, #1

mylovetop opened this issue Jan 1, 2020 · 0 comments

Comments

@mylovetop
Copy link

mylovetop commented Jan 1, 2020

<?xml version="1.0" ?>
<odoo>
    <record id="module_library_category" model="ir.module.category">
        <field name="name">Library</field>
    </record>
    <!-- Library User Group -->
    <record id="library_group_user" model="res.groups">
        <field name="name">User</field>
        <field name="category_id" ref="module_library_category" />
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
    </record>
    <!-- Library Manager Group -->
    <record id="library_group_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="category_id" ref="module_library_category" />
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
        <field name="users" eval="[
                    (4, ref('base.user_root')),
                    (4, ref('base.user_admin'))
                ]" />
    </record>
    <data noupdate="1">
        <record id="book_user_rule" model="ir.rule">
            <field name="name">Library Book User Access</field>
            <field name="model_id" ref="model_library_book" />
            <field name="domain_force">
                [('active','=',True)]
            </field>
            <field name="groups" eval="[(4,ref('library_group_user'))]" />
        </record>
    </data>
</odoo>

以上代码中,

<record id="library_group_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="category_id" ref="module_library_category" />
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
        <field name="users" eval="[
                    (4, ref('base.user_root')),
                    (4, ref('base.user_admin'))
                ]" />
    </record>

服务器代码启动一直报错,

raise ValidationError(_('The user cannot have more than one user types.'))
odoo.tools.convert.ParseError: "一个用户不能有多种用户类型
None" while parsing /Users/odoo-12.0/my-modules/library_app/security/library_security.xml:13, near
<record id="library_group_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="category_id" ref="module_library_category"/>
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
        <field name="users" eval="[                     (4, ref('base.user_root')),                     (4, ref('base.user_admin'))                 ]"/>
    </record>

把users 代码注释掉, 能正常启动,但是新建的菜单无法显示,请教下 这个怎么解决? 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant