How to Add a Domain to a Field Dynamically based on another Field – CBMS Odoo ERP

How to Add a Domain to a Field Dynamically based on another Field – CBMS Odoo ERP

2
0 minutes, 9 seconds Read

Similar Posts

2 Comments

  1. avatar
    @mohamedsobh2626 says:

    @api.onchange('category_id')
    def _onchange_category_id(self):
    print('hi………………..', self.category_id)
    products = []
    if self.category_id:
    products = self.env['product.product'].search([('categ_id', '=', self.category_id.id)]).ids
    print('list………………..', products)
    return {'domain': {'farm_materials_oline.product_id': [
    ('id', 'in', products)
    ]}}

    it return in log the result but the field product still read all product?!

Leave a Reply

Your email address will not be published. Required fields are marked *