Hello,
I am trying to identify the correct Odoo term for the view when creating a delivery address in contacts. I mean the small view.
I want to inherit the view and add a custom field.
Thank you for your help!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I am trying to identify the correct Odoo term for the view when creating a delivery address in contacts. I mean the small view.
I want to inherit the view and add a custom field.
Thank you for your help!
Hi,
The correct Odoo term for the delivery address form view in contacts is view_partner_address_form. To confirm, activate developer mode, inspect the view, and find its External ID.
To inherit this view and add a custom field, create a custom module with a __manifest__.py file that depends on the base module. In models.py, inherit the res.partner model and add your custom field. In views.xml, create a record that inherits base.view_partner_address_form and use an XPath expression to position your custom field within the inherited view. Install the module to apply the changes.
Eg:
Python
from odoo import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
my_custom_field = fields.Char(string="My Custom Field")
XML
<odoo>
<record id="view_partner_address_form_inherit" model="ir.ui.view">
<field name="name">res.partner.address.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_address_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='city']" position="after">
<field name="my_custom_field"/>
</xpath>
</field>
</record>
</odoo>
Hope it helps
Hi,
It's hard to understand what you're referring to. What about a screenshot?
If I understood it correctly though, you might be looking for <record id="view_partner_address_form"
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Ol| İlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
|---|---|---|---|---|
|
|
1
Mar 15
|
4888 | ||
|
|
1
Nis 22
|
7434 | ||
|
|
3
Kas 25
|
275 | ||
|
|
2
Ağu 25
|
888 | ||
|
|
1
May 25
|
1915 |