Skip to Content
Menu
This question has been flagged
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
Avatar
Discard
Related Posts Replies Views Activity
0
May 19
3408
1
Nov 19
5169
0
Aug 20
1415
1
Jul 19
4036
2
May 17
10098