Skip to content Skip to sidebar Skip to footer

Odoo How To Filter Many2one Field Values In One2many Field

I have many2one field name_id. Usually when I use it in my_model.xml code below in this field I can select from all the values written in my.model.line. In this case I want to filt

Solution 1:

You can achieve this by simply giving domain to your many2one field. try this:

name_id = fields.Many2one('my.model.line', string='Product', domain=lambda self: [('my_model_id', '=', self.model_id)])

Post a Comment for "Odoo How To Filter Many2one Field Values In One2many Field"