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, 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
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.