跳至內容
選單
此問題已被標幟
1 回覆
2124 瀏覽次數

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
553
4
10月 19
32813
1
4月 17
3366
2
3月 15
6711
2
1月 24
13271