跳至内容
菜单
此问题已终结
1 回复
2579 查看

For example I have menu named blank_loans_all in status.xml:

id="swiss_capital_collection_blank_loans_all"
parent="swiss_capital_collection_blank_loans"
action="swiss_capital_collection_tree_view_act_window"
groups="swiss_capital_collection.sw_group_collection_problems_head"/>

I want to set ir.rule to this menu for group problems_head . users from this group shouldn't be able to edit records in this menu(readonly)
any suggestions?

形象
丢弃
最佳答案

Hi

Try this code,

<record id="swiss_capital_collection_problems_head_rule" model="ir.rule">
            <field name="name">Restrict Editing for Problems Head</field>
            <field name="model_id" ref="model_id"/>
            <field name="groups" eval="[(4, ref('problems_head'))]"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
  </record>

Replace model_id with your actual model name. Upgrade your module to apply the changes.

Hope it helps

形象
丢弃
相关帖文 回复 查看 活动
0
12月 24
1215
4
10月 19
34061
1
4月 17
4016
2
3月 15
7454
2
1月 24
13986