Hi Community,
I inherited the view of model[res.config.settings]. i add the new field in this model after filling the field when i save the record at that time field would be blank. why field is not save please suggest me.
See my Code :
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
order_approval = fields.Boolean(string="Order Approval", implied_group='sale_management.group_sale_order_template')
minimum_amount = fields.Char(string="Minimun Amount")
@api.onchange('order_approval')
def _onchange_order_approval(self):
if not self.order_approval:
self.minimum_amount = False
.XML
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="sales_order_res_config_settings_view_form" model="ir.ui.view">
<field name="name">sales.order.res.config.settings.view.form.inherit.sale</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="10"/>
<field name="inherit_id" ref="sale.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div/div/div[@id='sale_config_online_confirmation_sign']" position="before">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="order_approval"/>
</div>
<div class="o_setting_right_pane">
<label for="order_approval"/>
<div class="text-muted">
Managers must approve orders
</div>
<div class="content-group" attrs="{'invisible': [('order_approval', '=', False)]}">
<div class="mt16">
<label for="minimum_amount" class="o_light_label"/>
<field name="minimum_amount" class="oe_inline"/>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>