I have added
<div name="button_box">
<field name="active" invisible="1"/>
<button type="object" icon="fa-archive" name="toggle_active" string="Archive" attrs="{'invisible': [('active', '=', False)]}"/>
<button type="object" icon="fa-archive" name="toggle_active" string="Restore" attrs="{'invisible': [('active', '=', True)]}"/>
</div>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
this to the sheet of the form of my view but unfortunately, the buttons do not get displayed.
This is what I want:
But this is what it looks like:
what is missing?
CodePudding user response:
That is not the button box but the action menu. IIRC you can't add anything there by extending a view, but by creating actions.
And if you want to add the archive functionality in Odoo 14 you just have to add the field active invisible in your form view. That should be enough and is an exception to my statement before ;-)
If you need the ribbon, you have to add that, too, like in your example.
Edit: seems you should not put the field active into a div or probably the button_box div.


