odoo - 如何在 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 中的字段视图和表单更改吗?
解决方案
您可以使用many2many_checkboxes
which 将列出所有组,您可以选择而无需任何搜索。
<field name="groups_id" widget="many2many_checkboxes" />
推荐阅读
- r - 转换为日期格式字符
- c - 链表的时间复杂度是多少?
- elasticsearch - Elasticsearch 中的嵌套字段、通配符查询和聚合
- javascript - 如何在 Typescript 中将按钮 ID 从 onClick 发送到 handleClick
- python - 如何在仅包含列表的类上实现散列?
- python - 如何用另一个 DataFrame 值更新几个 DataFrames 值?
- flutter - 有没有可能的方法来实现(照片+视频)编辑器?
- python - 错误:使用 ACTIVE 的“'Listbox' 对象不可调用”
- java - 如果我删除 int 和 number 之间的点,为什么会出现错误?
- javascript - 如何使用谷歌地图设置集群的数量?