Skip required fields odoo
- Install the module
- Add comma-separated list of fields to the "skip_is_valid" key of context for the button in form view
- Also, you can use the "all" keyword to skip all fields like that:
context="{'skip_is_valid':['all']}"
Code example:
<!-- Step 4 - code example -->
<record id="sale_view_form_inherited" model="ir.ui.view">
<field name="name">sale.view.form.inherited</field>
<field name="model">sale</field>
<field name="inherit_id" ref="sale.sale_view_form"/>
<field name="arch" type="xml">
<data>
<!-- If you need inherit existing button -->
<button name="action_send" position="attributes">
<attribute name="context">{'skip_is_valid':['all']}</attribute>
</button>
<!-- When you add a new button -->
<button name="action_cancel" string="Cancel" type="object"
states="registered" class="oe_highlight" groups="base.group_user"
context="{'skip_is_valid':['extension_agreement_id','observation']}"/>
</data>
</field>
</record>This module is based on xf_form_button_upgrade by XFanis, originally developed for Odoo 10.
This version has been adapted and updated for Odoo 13, including:
- Compatibility updates for Odoo 13
- Code improvements and bug fixes
Special thanks to the original author for the initial implementation.