Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8434 มุมมอง

Using version 13, this is what users see when they create a new Contact from a Company Contact:


This is what I want them to see:

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

The default is set based on the View XML:

https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/views/res_partner_views.xml#L291

context="{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 
'default_city': city, 'default_state_id': state_id, 'default_zip': zip,
'default_country_id': country_id, 'default_lang': lang, 'default_user_id': user_id,
'default_type': 'other'}">

The context contains all the default values that are "sent" to the popup form.

You can override these values with your own View:

If you hover over the radio buttons in Developer Mode, you can see the value you need to have instead of OTHER in order to default to CONTACT.


Then make a View like this:


<field name="child_ids" position="attributes">
<attribute name="context">{'default_parent_id': active_id,
'default_street': street, 'default_street2': street2,
'default_city': city, 'default_state_id': state_id, 'default_zip': zip,
'default_country_id': country_id, 'default_lang': lang, 'default_user_id': user_id,
'default_type': 'contact'}
</attribute>
</field>


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 22
4554
1
ส.ค. 17
5491
2
ก.ค. 25
851
1
ก.ย. 24
1462
0
ก.ค. 24
1265