Odoo Help

0

How to set domain of another model

By
Sutanto
on 3/24/16, 2:46 AM 660 views

I have Model A, B and C. Model A contains B and C. Need to domain field at Model C based on record of B.

class ModelA(models.Model)
model_line_b = fields.One2many('model.b', inverse_name='a_id')
model_line_c = fields.One2many('model.c', inverse_name='a_id')
...

class ModelB(models.Model)
a_id = fields.Many2one('model.a')
city_id = fields.Many2one('model.city')
...

class ModelC(models.Model)
a_id = fields.Many2one('model.a')
city_id = fields.Many2one('model.city', domain=[('id', 'in', city id at model_line_b)])

How to set domain at model_b.city_id?

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.

Register

Odoo Training Center

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

Test it now

Question tools

1 follower(s)

Stats

Asked: 3/24/16, 2:46 AM
Seen: 660 times
Last updated: 3/24/16, 2:58 AM