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

Can anyone help me how to hide or disable Edit and/or Create button when my workflow status value is "Done"

I have workflow status "Draft > Approval > Confirmed > Done"

so when status is Done i want 'Edit' to be hidden or disabled.

Please help. thanks in advance.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Add edit="false" in form view.

<form string="XXX" edit="false">
</form>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Have you seen "Web Access Rules Buttons" at https://www.odoo.com/apps/modules/9.0/web_access_rule_buttons/

This addon disables the Edit button on the form views if the user cannot edit the current record according to the record access rules.


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can add this in your form views:

<field name="context">{'form_no_edit':[('state','=','done')]}</field> 


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can also put in your definition view:

<form string="Some text" version="7.0" create="false" delete="false">
</form>


With this you can hide the create/edit button and the delete option in the More dropdown button.

This option will disable the buttons for everyone.  Maybe Ray's solution it's more suitable for your needs.


:)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 16
3257
0
thg 10 16
2817
0
thg 9 23
1855
2
thg 9 23
7510
0
thg 9 23
1555