Комментарии:
Unfortunately, it doesn't work in Odoo 16 :/
Ответить@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?!