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

is there a way to send more fields than just display_name and id from related model in odoov14?

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

Hello Mohammad Fallahi, 

Please find code in comment. 

I hope this will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

อวตาร
ละทิ้ง

please try this

there are two ways:

first Way
def name_get(self):
result = []
for rec in self:
display_name = f"[{rec.field_name}] {rec.field_name}"
result.append((rec.id, display_name))
return result

second way
def name_get(self):
record = []
for record in self:
record.append((res.id, '%s - %s' % (res.field_name, field.field_name)))
return record

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 23
3830
1
ม.ค. 23
8607
ReferenceError: instance is not defined แก้ไขแล้ว
1
ธ.ค. 20
8155
1
มี.ค. 15
10574
2
มี.ค. 25
1272