How to hide the edit and create buttons conditionally in a form view of a model?
For example i want to hide these buttons if the state for the model is 'Done', if it is not then they should appear.
Thanks in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to hide the edit and create buttons conditionally in a form view of a model?
For example i want to hide these buttons if the state for the model is 'Done', if it is not then they should appear.
Thanks in advance.
Hi Santos,
You can hide the edit and create buttons conditionally using record rule. You need to set a domain in record rule.
<record model="ir.rule" id="reference_id">
<field name="name">reference name</field>
<field name="model_id" ref="model_model_name"/>
<field eval="0" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
<field name="domain_force">[ ('state','in',['open','paid'])]</field>
</record>
Can you elaborate more on this?
this module will help.
https://github.com/faniska/odoo-addons/tree/10.0/hide_action_buttons
It is for Odoo 10, but code is simple to port for latest versions.
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
Button to open form. V11
Rozwiązane
|
|
2
mar 19
|
2706 | |
|
2
paź 18
|
4796 | ||
|
2
mar 23
|
9028 | ||
Cacher le bouton "créer" d'une liste
Rozwiązane
|
|
2
mar 23
|
1641 | |
|
2
lip 22
|
8183 |
you can restrict the edit button by extending the formview js