I want to change the position of the default phone number field in customer form and add another two fields for secondary and tertiary phone number field.
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
5601
Views
Hi Nilang,
You can do this by inheriting the view and creating an xpath expression for it. Your code should look something like this:
<?xml version="1.0" encoding="utf-8"?> <odoo> <record id="res_partner_form_view_phonechange" model="ir.ui.view"> <field name="inherit_id" ref="base.view_partner_form"/> <field name="model">res.partner</field> <field name="arch" type="xml"> <!-- Remove the phone field --> <xpath expr="//field[@name='phone']" position="replace"></xpath> <!-- Add the phone field on the place you'd like --> <xpath expr="//field[@name='street'"]" position="after"> <field name="phone"/> <field name="your_second_field"/> <field name="your_third_field"/> </xpath> </field> </record> </odoo>
Note: don't forget to first create your custom fields on the Python side (or through the frontend)
Regards,
Yenthe
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Jul 24
|
940 | ||
|
1
Jun 24
|
3561 | ||
|
1
Oct 23
|
8589 | ||
|
1
Oct 23
|
97 | ||
413 Request Entity Too Large
Solved
|
|
1
Aug 23
|
2192 |
Read more in details, Inheritance in models and views: https://goo.gl/4Zyc9d
Thank you Sehrish. I'll check this out.