Question: I'm encountering issues while trying to use conditional statements (t-if, invisible) in my XML view based on the status field defined in the Python file. Despite trying multiple approaches, including t-if and invisible, the button visibility doesn't change as expected based on the status field.
status = fields.Selection(
string="Status",
selection=[('draft', 'Draft'), ('pending_approval', 'Pending Approval'), ...],
default='draft'
)
Issue Description:
- status field is properly defined in the Python file.
- Attempts to use t-if, invisible, and other methods based on the status field haven't yielded the expected outcome in the view.
- Seeking guidance on the correct way to conditionally show/hide buttons based on the value of the status field.
Hi, in odoo 17 attrs are no more used.
so here is an example of hiding a button based on states.