首页 > 解决方案 > 组的名称是什么?在 odoo 10

问题描述

创建组并在此处查看后

https://i.stack.imgur.com/RvxKd.png

我还想以这种形式查看组

https://i.stack.imgur.com/tdl9j.png

标签: pythonodoo-10

解决方案


如果我猜对了,您需要在用户表单中添加安全组。

如果是,那么这里是答案:

  • 首先,您需要转到您的自定义模块。
  • 创建名为“securtiy”的文件夹,并在该文件夹中创建“security.xml”

    (名称不具体,如果您想更改文件名,则可以。)

  • 添加以下代码:

    <record id="group_module_name" model="res.groups"> <field name="name">group_name(any string you want)</field> <field name="category_id" ref="category_name"/> (This line is only for if you want to show group under specific category) <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> (Automatically checked this group that you specified in 'eval' after checked 'group_module_name' group.) </record>

参考链接:

https://github.com/odoo/odoo/blob/13.0/addons/account/security/account_security.xml

评论回复:

好的,那么这是您的参考图像中显示的用户弹出视图。 https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/views/res_users_views.xml#L117

通过这个属性看到这些不会出现在弹出视图中,

odoo 使用的属性:attrs="{'invisible': [('id', '>', 0)]}"

根据您的需要进行更改。


推荐阅读