Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
How can we use dynamic domains in new Odoo API?
I'm trying to do it, I have an Many2one field, and a compute One2many field. Options to be select by Many2one field should be in this One2many field.
Here are my code lines:
days = fields.One2many('af.week.day', string='Class days', compute='_compute_days',
help='Week days in which this group has classes')
day_of_week = fields.Many2one('af.week.day', string='Day of week', domain="[('id','in',days)]")
In the new Odoo API it is the same as in Version 7.0. Look at this example:
'field_b': [('domain', '=', 'something')],
'field_b': [('domain', '=', 'something_else')],
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
|Asked: 12/22/14, 11:10 AM|
|Seen: 2164 times|
|Last updated: 6/17/15, 4:08 AM|