How to do it...

  1. Inject the field in to the default form view:
<record id="view_partner_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="website" position="after">
<field name="write_date" />
</field>
</field>
</record>
  1. Add the field to the default search view:
<record id="view_res_partner_filter" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<xpath expr="." position="inside">
<field name="mobile" />
</xpath>
</field>
</record>
  1. Add the field to the default list view:
<record id="view_partner_tree" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree" />
<field name="arch" type="xml">
<field name="email" position="after">
<field name="phone" position="move"/>
</field>
</field>
</record>

After updating your module, you should see the Last updated on extra field beneath the website field on the partner form. When you type something into the search box, it should suggest that you search for the partners on the mobile field, and in the partner's list view, you will see that the order of the phone number and email has changed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset