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

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
مايو 23
3838
1
يناير 23
8610
1
ديسمبر 20
8160
1
مارس 15
10582
2
مارس 25
1278