[IMP] Remove domain from onchange method and put it in field view

This commit is contained in:
Florian da Costa
2023-11-28 12:56:20 +01:00
committed by JasminSForgeFlow
parent fbf2881b76
commit cd46134010
2 changed files with 2 additions and 1 deletions

View File

@@ -730,7 +730,7 @@ class RmaOrderLine(models.Model):
) )
if self.lot_id.product_id != self.product_id: if self.lot_id.product_id != self.product_id:
self.lot_id = False self.lot_id = False
return {"domain": {"lot_id": [("product_id", "=", self.product_id.id)]}} return result
@api.onchange("operation_id") @api.onchange("operation_id")
def _onchange_operation_id(self): def _onchange_operation_id(self):

View File

@@ -203,6 +203,7 @@
groups="stock.group_production_lot" groups="stock.group_production_lot"
attrs="{'required': [('product_tracking', 'in', ('serial', 'lot'))]}" attrs="{'required': [('product_tracking', 'in', ('serial', 'lot'))]}"
context="{'default_product_id': product_id,}" context="{'default_product_id': product_id,}"
domain="[('product_id', '=', product_id)]"
/> />
<field name="under_warranty" /> <field name="under_warranty" />
</group> </group>