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

Hi, 

I have a user who likes to work with numbers. He wants to see the id field concatenated with the name of the customers in the search to create a sale order.




Does anyone know how I can achieve this? We are using v14. 

Regards. 


頭像
捨棄
作者

It work's like a charm. Thank you. 


最佳答案

Hi,
You can use the name_get() function in res.partner model.

def name_get(self):
res = []
for record in self:
name = record.name
rec_id = str(record.id)
display_name = rec_id + ' ' + name
res.append((record.id, display_name))
return res

Here you will get the id with name


Regards

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
3月 18
7260
5
8月 24
3359
0
2月 24
28
1
5月 23
5734
0
1月 22
2828