diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2015-09-23 14:36:03 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2015-09-23 19:33:24 +0200 |
| commit | ed5eecf59a08a173593ab407dc01b60e0b95f114 (patch) | |
| tree | 7e666446aa8d05822257987eb18e09ab67f6eaff /addons | |
| parent | b460f9a2aa79558b05bf475a1107694e5d26a870 (diff) | |
[FIX] sale_stock: warning only if quantity decreased
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/sale_stock/i18n/sale_stock.pot | 4 | ||||
| -rw-r--r-- | addons/sale_stock/sale_stock.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/addons/sale_stock/i18n/sale_stock.pot b/addons/sale_stock/i18n/sale_stock.pot index 36dba4e9e59..93d44e66e2a 100644 --- a/addons/sale_stock/i18n/sale_stock.pot +++ b/addons/sale_stock/i18n/sale_stock.pot @@ -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 diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 049857267ff..59b9f24dfce 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -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 {} |
