Skip to content
Snippets Groups Projects
Commit ed5eecf5 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] sale_stock: warning only if quantity decreased

parent b460f9a2
Branches
Tags
No related merge requests found
......@@ -142,7 +142,7 @@ msgstr ""
#. module: sale_stock
#: code:addons/sale_stock/sale_stock.py:148
#, python-format
msgid "Ordered quantity changed!"
msgid "Ordered quantity decreased!"
msgstr ""
#. module: sale_stock
......@@ -262,7 +262,7 @@ msgstr ""
#. module: sale_stock
#: code:addons/sale_stock/sale_stock.py:149
#, python-format
msgid "You have changed the quantity ordered! If the quantity was decreased, you need to modify manually the delivery order."
msgid "You are decreasing the ordered quantity! Do not forget to manually update the delivery order if needed."
msgstr ""
#. module: sale_stock
......
......@@ -148,10 +148,10 @@ 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':
if self.state == 'sale' and self.product_id.type != 'service' and self.product_uom_qty < self._origin.product_uom_qty:
warning_mess = {
'title': _('Ordered quantity changed!'),
'message' : _('You are changing the ordered quantity! If you decreased the initial quantity, do not forget to manually update the delivery order if needed.'),
'title': _('Ordered quantity decreased!'),
'message' : _('You are decreasing the ordered quantity! Do not forget to manually update the delivery order if needed.'),
}
return {'warning': warning_mess}
return {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment