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

Dear Community,

      I have created a global record rule (ir.rule) to allow record change (edit) only when it is in "draft" state. Which works fine, but it also stops me from changing the state of the record back to 'draft' from the button function ( self.write({'state':'draft'})  ). 

ir.rule:    

 <record id="edit_only_in_draft" model="ir.rule">

        <field name="name">Edit only in draft</field>

        <field name="model_id" ref="model_model_name"/>

        <field name="global" eval="True"/>

        <field name="domain_force">[('state','=','draft')]</field>

<field name="perm_read" eval="False" />
<field name="perm_write" eval="True" />
<field name="perm_unlink" eval="True" />
<field name="perm_create" eval="False" />

    </record>


How can I allow only the state change while keeping the ir.rule?

Thanks in advance

Kind Regards,

Rohail

形象
丢弃

Hello Rohail, did you manage to find a solution for this?

相关帖文 回复 查看 活动
1
1月 19
21094
5
4月 16
13939
1
4月 16
5210
1
5月 16
6252
7
11月 15
10043