تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
684 أدوات العرض

I’m currently working in Odoo Contacts and would like to create an address field in a specific format, but I haven’t been able to do so.

The version I try to achieve is:

Customer:  ​Company Name

​Street

​postal code, Region

​country


Originally, there was a field like this available in the Contacts module, but I accidentally deleted it. Unfortunately, the predefined fields such as “Complete Address” or “Inlined Complete Address” do not match the format I need.

Could you please help me create a custom address field that meets the desired format?

الصورة الرمزية
إهمال
أفضل إجابة

Hi Elvira Brown,


I hope you're doing well.

Regarding your request to recreate a custom address field in the specific format below:


// Code in Comment//


Image - 

Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

الصورة الرمزية
إهمال

Code :

<record id="view_for_address_form" model="ir.ui.view">
<field name="name">res.partner.address.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//span[@name='address_name']" position="replace">
<span class="o_form_label o_td_label o_address_type" name="address_name">
<span invisible="is_company">Custom for Address Name for Person</span>
<span invisible="not is_company">Custom Address Name for company</span>
</span>
</xpath>

<xpath expr="//div[@class='o_address_format']" position="replace">
<div class="o_address_format">
<field name="street" placeholder="Street..." class="o_address_street"/>
<field name="zip" placeholder="Postal code" class="o_address_zip"/>
<field name="state_id" placeholder="Region" class="o_address_state"
options="{'no_open': True, 'no_quick_create': True}"
context="{'country_id': country_id, 'default_country_id': country_id, 'zip': zip}"/>
<div name="partner_address_country" class="d-flex justify-content-between">
<field name="country_id" placeholder="Country" class="o_address_country"
options="{&quot;no_open&quot;: True, &quot;no_create&quot;: True}"/>
</div>
</div>
</xpath>
</field>
</record>

الكاتب

Thank you very much, Jainesh. Could you please provide more detailed information on where exactly I should insert this code?

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أكتوبر 24
2729
1
مايو 25
1342
1
مارس 25
1523
MERGING CONTACTS تم الحل
1
فبراير 25
2283
Use of external id تم الحل
2
فبراير 25
2659