Add custom field to partner model
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
4589
Views
Hi,
If you just want to add a new field to the res.partner model inheit the class in Python and add the field.
ClassResPartner(models.Model):
_inherit = 'res.partner'
field_new = fields.Char('field')
And to add it to the view you can use xpath, this is a sample one,
<record id="view_partner_form" model="ir.ui.view"> <field name="name">res.partner.form</field> <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_form"/> <field name="archh" type="xml"> <field name="a_field_name" position="after">
<field name="field_new"/>
</field> </field> </record>
Thanks
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up