首页 > 解决方案 > 如何在 res.users odoo 中更改自动填充组名称

问题描述

我在自定义模块中创建了新的安全性,就像这样

<record model="ir.module.category" id="module_create">
  <field name="name">Module Role</field>
  <field name="description">User access level for this module</field>
  <field name="sequence">5</field>
</record>
<record id="group_merc" model="res.groups">
  <field name="name">Merc Access</field>
  <field name="category_id" ref="mymodule.module_create"/>
  <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
</record>

我像这样使用res.users类制作另一个表单视图

<page name="access_rights" string="Access Rights">
                            <field name="groups_id" widget="many2many_tags" options='{"no_create": True, "no_open": True}'/>
                        </page>

像这样显示 在此处输入图像描述 的字段我可以通过显示我自动创建的组名称而无需先进行搜索来删除 groups_id 中的字段视图和表单更改吗?

标签: odooodoo-9

解决方案


您可以使用many2many_checkboxeswhich 将列出所有组,您可以选择而无需任何搜索。

<field name="groups_id" widget="many2many_checkboxes" />

推荐阅读