[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:
Nicolas Martinelli
2015-11-27 12:47:13 +01:00
parent 7ddfd6285c
commit 2eccd6352f
+1 -1
View File
@@ -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.'),