跳至內容
選單
此問題已被標幟
1 回覆
2475 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
0
5月 23
3839
1
1月 23
8610
1
12月 20
8160
1
3月 15
10588
2
3月 25
1278