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')],
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
|Asked: 12/22/14, 11:10 AM|
|Seen: 1918 times|
|Last updated: 6/17/15, 4:08 AM|