Hi;
how to fix a domain on Many2many on odoo 10 without using a on_chnage function but the domain property:
dispensed_ids = fields.Many2many('school.matiere','dispensed_subjects',string='Dispensed Subjects',domain=lambda self: self._get_matietre_domain())
@api.onchange('dispensed_ids')
defitem_delivered_ids_onchange(self):
return {'domain': {'dispensed_ids':[('level_id', '=',[self.inscription_ids.mapped('class_id.level_id.id')])] } }
@api.model
def_get_matietre_domain(self):
domain = []domain.append(('level_id', 'in',self.inscription_ids.mapped('class_id.level_id.id')))
return domain