如何解决基于 Notebook 中的组权限限制添加评论 - Odoo 14
我想知道这是否可以限制添加基于我在应用程序中定义的组的评论,因为我看到的唯一属性是隐藏笔记本小部件,但这不是我需要的
<!-- Set log notes invisible for specific user groups-->
<record model="ir.ui.view" id="project_task_log_notes">
<field name="name">project.task.log.notes</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="div[@class='oe_chatter']" position="replace">
<group name="log" class="oe_chatter" groups="rw_project.group_project_rm">
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</group>
</xpath>
<xpath expr="//page[@name='description_page']" position="attributes">
<attribute name="string">Comments</attribute>
</xpath>
</field>
</record>
解决方法
IMO 您可能有以下选项来解决问题。
-
开发一个小函数,用于检查当前登录的用户访问权限/组并返回布尔值。根据布尔值,您可以在 Comment 字段上设置只读属性。
-
您可以在“评论”字段中添加
groups
属性。并且只能由具有访问权限/安全组的用户访问。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。