[FIX] sale_stock: restrict warning message
Warning message should be displayed only for stockable or consumable. Before this fix, it would also apply to digital products.
This commit is contained in:
@@ -134,7 +134,7 @@ class SaleOrderLine(models.Model):
|
||||
|
||||
@api.onchange('product_uom_qty')
|
||||
def _onchange_product_uom_qty(self):
|
||||
if self.state == 'sale' and self.product_id.type != 'service' and self.product_uom_qty < self._origin.product_uom_qty:
|
||||
if self.state == 'sale' and self.product_id.type in ['product', 'consu'] and self.product_uom_qty < self._origin.product_uom_qty:
|
||||
warning_mess = {
|
||||
'title': _('Ordered quantity decreased!'),
|
||||
'message' : _('You are decreasing the ordered quantity! Do not forget to manually update the delivery order if needed.'),
|
||||
|
||||
Reference in New Issue
Block a user