Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2478 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

Hello Mohammad Fallahi, 

Please find code in comment. 

I hope this will help you. 

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

Avatar
Zrušit

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 Odpovědi Zobrazení Aktivita
0
kvě 23
3839
1
led 23
8612
1
pro 20
8162
1
bře 15
10589
2
bře 25
1278