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

Im working on a extension for the res.partner model, so, now i'm trying to change the _rec_name because i've added a computed field who bring me more info than just the name of the partner.

It's possible to override the _rec_name of the res_parner, or i have to override an specific function from res_partner?



頭像
捨棄
最佳答案

Hi

You just have to inherit the res.parther object and then add then field name in _rec_name property.

    class ResPartner(models.Model)
_inherit = 'res.partner'
_rec_name = 'your_field_name'

Hope this will solve your problem.

頭像
捨棄
作者

Sadly, isn't working I'm calling the records from another model so I think I have to modify the search_name function.

In that case you should override name_get() method that will do the job.

On Dec 11, 2017 7:33 PM, "Nicolás Mena" <nicolas.mena@uchile.cl> wrote:

Sadly, isn't working I'm calling the records from another model so I think I have to modify the search_name function.

--
Nicolás Mena


Sent by Odoo S.A. using Odoo.

作者

Thanks for the help, I'm now re-coding the name_get method

最佳答案

could you let me show how you re-coding name_get method I have same Issue

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
9月 18
6406
2
7月 24
2618
1
6月 24
5092
1
10月 23
10780
1
10月 23
98