stateodooodoo-13one2many

Is it possible to hide/invisible notebook page based on states? (Odoo 13)


I have the notebook page and 4 states in the form view.

I want the notebook page just to show in states 1 and 2 when clicking the wizard button. But when it changes to states 3 and 4, it will be hide/invisible. So is it possible to do it?

Please help! Thank you!


Solution

  • Add invisible attributes for the page.

    <page string="Product Details" attrs="{'invisible':[('state', 'in', [2, 4])]}">
    ...
    </page>
    

    If state in [2, 4] is true, then the page will be invisible.

    For more details, read reference