Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5128 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 19
21020
5
thg 4 16
13885
1
thg 4 16
5166
1
thg 5 16
6203
7
thg 11 15
9989