Odoo Help

Welcome!

This community 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.

0

How to set domain of another model

By
Sutanto
on 3/24/16, 2:46 AM 320 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?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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