Add product_uom_max_qty to constraint
This commit is contained in:
parent
b2d4830a77
commit
80a72f0674
1 changed files with 1 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ class SaleOrderLine(models.Model):
|
||||||
product_uom_min_qty = fields.Float(string="Min qty.", digits="Product Unit of Measure")
|
product_uom_min_qty = fields.Float(string="Min qty.", digits="Product Unit of Measure")
|
||||||
product_uom_max_qty = fields.Float(string="Max qty.", digits="Product Unit of Measure")
|
product_uom_max_qty = fields.Float(string="Max qty.", digits="Product Unit of Measure")
|
||||||
|
|
||||||
@api.constrains("product_uom_qty")
|
@api.constrains("product_uom_qty", "product_uom_max_qty")
|
||||||
def _check_product_uom_qty(self):
|
def _check_product_uom_qty(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.product_uom_qty > record.product_uom_max_qty:
|
if record.product_uom_qty > record.product_uom_max_qty:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue