跳至内容
菜单
此问题已终结
1 回复
2097 查看

In the field many2one, when I finish creating data in popup Create and Edit. . .Then the name will be displayed in the default field many2one. I want it to show partner_name. What do I have to do? I tried setting _rec_name = "partner_name" but it not working. Thanks a lot!

形象
丢弃
最佳答案

Hi,

You might have to inherit and change the name_get function of the res.partner model.

See: https://www.youtube.com/watch?v=aT_tsfW5HaQ

Thanks

形象
丢弃
编写者

Hi Niyas Raphy, Thanks for your answer! But I tried to inherit name_get function.
My code:
def name_get(self):
result = []
for record in self:
result.append((record.id, '%s' % record.partner_name))
return result

It was showing properly.
But I want to say, at the end of creating new data in the popup Create and Edit...
It displays the name, not partner_name.

相关帖文 回复 查看 活动
3
3月 24
7013
2
2月 24
2193
2
2月 25
5854
1
12月 24
1413
4
5月 24
12622