to explain it , Let us say we have selection field type which is has two selection values "in , out " as bellow
type = fields.Selection([('in','In'),('out','Out'), string="Type"])
and we want to make it's default value "in" from xml , so when we create our view we can pass the default value "in" with context as bellow
<record id="view_id_form" model="ir.ui.view">
<field name="name">model.model.form</field>
<field name="model">model.model</field>
<field name="name">model.model.form</field>
<field name="model">model.model</field>
<field name="context">{'default_type':'in'}</field>
<field name="arch" type="xml">
<form>
No comments:
Post a Comment