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

Here on sale order delivery tab, I want to show the address fields while selecting on delivery address.

For example on sale order when we select customer then on selection we can see company name and contact name (my company,contact name) like this i want show (my company,contact name,contact's address).


How can i show as per this requirement?

อวตาร
ละทิ้ง

By default, Odoo allows searching customers only by name and displays only the name in Many2One fields. This module enhances the Many2One search and display functionality by enabling users to search using multiple fields (Phone, Email, Mobile, etc.) and display multiple values directly inside the Partners Many2One selection.
https://apps.odoo.com/apps/modules/17.0/mh_partner_search_and_display_multiple_field

คำตอบที่ดีที่สุด

Hi,

You can override the name_get function and return a value as your wish.

Try this code. 

class Customer(models.Model):

_inherit = 'res.partner'

@api.multi
def name_get(self):
res = []
for record in self:
name = record.name
if record.street:
name = record.name + "," + record.street
res.append((record.id, name))
return res

Thank you 

อวตาร
ละทิ้ง
ผู้เขียน

Thank You Avinash!!!

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
9587
0
ม.ค. 23
1493
2
พ.ค. 22
18048
1
ม.ค. 22
3409
Advanced Search: How to remove fields? แก้ไขแล้ว
4
เม.ย. 19
12896