Hi, I have a button in the invoice form view. I wish to hide it if a condition is meet. The button is defined as follows;
I wish to hide it if the fiscal_position_id is set to NR. I use odoo 10
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi, I have a button in the invoice form view. I wish to hide it if a condition is meet. The button is defined as follows;
I wish to hide it if the fiscal_position_id is set to NR. I use odoo 10
Hi,
For hiding a button based on some conditions , first of all we should inherit the view of the button and in its xpath we can provide the attribute tag , inside that we can provide the 'attrs ' condition as given below.
Here i just hiding the confirm button based on some condition.
<xpath expr="//button[@name='action_confirm'][1]" position="attributes">
<attribute name="attrs">{'invisible': ['|',('is_warning', '=', True),('state', 'not in', ['draft'])]}</attribute>
</xpath>
<xpath expr="//button[@name='action_confirm'][2]" position="attributes">
<attribute name="attrs">{'invisible': [('state', 'not in', ['sent'])]}</attribute>
</xpath>
Regards
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up