Odoo Help


2 答案

Rishan Malaka 斯里兰卡

--Rishan Malaka--
| 4 2 6
Colombo, 斯里兰卡
--Rishan Malaka--

Software Engineer(Odoo) - Capital TRUST Information Technologies (Pvt) Ltd.

Rishan Malaka 斯里兰卡
2017/10/9 上午7:54


For that you have to inherit res.partner  in your "
machine_weight" class

6 注释
SunArc Technologies, Pawan Kumar Sharma 印度
2017/10/9 上午7:57

For this i added below field in "machine_weight" class:

pet = fields.Many2one('res.partner.pet_name')

Rishan Malaka 斯里兰卡
2017/10/9 上午8:02

i noted that.but you have to inherit that res.partner on your machine_weight class to build relationship.

SunArc Technologies, Pawan Kumar Sharma 印度
2017/10/9 上午8:08

Now, I also try this. But, getting 'False' value for this field on terminal by printing "print "r:", record.name"

SunArc Technologies, Pawan Kumar Sharma 印度
2017/10/10 上午2:05

Hello Rishan,

Now, My function work well. But, Can u tell me how to call this function for particular class only, not global. My class name is "body_processing" where i want to call this 'name_get' function. My code is here:


def name_get(self):

result = []

for record in self:

name = '['

if record.pet_name:

name += record.pet_name + ']' + ' ' + record.name


name += '] ' + record.name

result.append((record.id, name))

return result

Rishan Malaka 斯里兰卡
2017/10/10 上午8:36

what is your purpose?

SunArc Technologies, Pawan Kumar Sharma 印度
2017/10/10 上午8:58

Want to show other field(pet_name) in drop-down form res.partner except partner_id.

Keep Informed
1 关注者(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now