[FIX] sale_stock: scope of warning
The check on the ordered quantity should not apply to services. opw-1981332 closes odoo/odoo#33138 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -446,7 +446,8 @@ class SaleOrderLine(models.Model):
|
||||
|
||||
def _update_line_quantity(self, values):
|
||||
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||
if self.mapped('qty_delivered') and float_compare(values['product_uom_qty'], max(self.mapped('qty_delivered')), precision_digits=precision) == -1:
|
||||
line_products = self.filtered(lambda l: l.product_id.type in ['product', 'consu'])
|
||||
if line_products.mapped('qty_delivered') and float_compare(values['product_uom_qty'], max(line_products.mapped('qty_delivered')), precision_digits=precision) == -1:
|
||||
raise UserError(_('You cannot decrease the ordered quantity below the delivered quantity.\n'
|
||||
'Create a return first.'))
|
||||
super(SaleOrderLine, self)._update_line_quantity(values)
|
||||
|
||||
Reference in New Issue
Block a user