From 0fe7989e24fa4380c135fd7718991dfa4a66a101 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 15 Nov 2017 13:37:21 +0100 Subject: [PATCH] [FIX] stock: warning on move The warning should be a dictionary, not a string. opw-781880 --- addons/stock/i18n/stock.pot | 37 +++++++++++++++++++++++++++++++ addons/stock/models/stock_move.py | 10 ++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 82dd7251a1d..d3a06ce060f 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -2711,6 +2711,11 @@ msgstr "" msgid "Inventory Line" msgstr "" +#. module: stock +#: model:ir.actions.act_window,name:stock.action_inventory_line_tree +msgid "Inventory Lines" +msgstr "" + #. module: stock #: model:ir.model.fields,field_description:stock.field_product_product_property_stock_inventory #: model:ir.model.fields,field_description:stock.field_product_template_property_stock_inventory @@ -3004,6 +3009,11 @@ msgstr "" msgid "Linked Quant" msgstr "" +#. module: stock +#: model:ir.ui.view,arch_db:stock.view_inventory_form +msgid "List view of lines" +msgstr "" + #. module: stock #: model:ir.ui.view,arch_db:stock.view_location_form msgid "Localization" @@ -4597,6 +4607,11 @@ msgstr "" msgid "Quantity" msgstr "" +#. module: stock +#: model:ir.model.fields,field_description:stock.field_stock_pack_operation_qty_done_uom_ordered +msgid "Quantity Done" +msgstr "" + #. module: stock #: model:ir.ui.view,arch_db:stock.view_warehouse_orderpoint_form msgid "Quantity Multiple" @@ -4619,6 +4634,17 @@ msgstr "" msgid "Quantity cannot be negative." msgstr "" +#. module: stock +#: code:addons/stock/models/stock_move.py:394 +#, python-format +msgid "Quantity decreased!" +msgstr "" + +#. module: stock +#: model:ir.model.fields,help:stock.field_stock_pack_operation_qty_done_uom_ordered +msgid "Quantity done in UOM ordered" +msgstr "" + #. module: stock #: model:ir.model.fields,help:stock.field_stock_move_availability msgid "Quantity in stock that can still be reserved for this move" @@ -5122,6 +5148,11 @@ msgstr "" msgid "Search Inventory" msgstr "" +#. module: stock +#: model:ir.ui.view,arch_db:stock.stock_inventory_line_search +msgid "Search Inventory Lines" +msgstr "" + #. module: stock #: model:ir.ui.view,arch_db:stock.stock_scrap_search_view msgid "Search Scrap" @@ -5695,6 +5726,12 @@ msgstr "" msgid "The parent location that includes this location. Example : The 'Dispatch Zone' is the 'Gate 1' parent location." msgstr "" +#. module: stock +#: code:addons/stock/models/stock_picking.py:795 +#, python-format +msgid "The pick is already validated" +msgstr "" + #. module: stock #: model:ir.model,name:stock.model_stock_picking_type msgid "The picking type determines the picking view" diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 3c359c93b25..26db3fa010f 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -390,9 +390,13 @@ class StockMove(models.Model): if not self.product_id or self.product_qty < 0.0: self.product_qty = 0.0 if self.product_qty < self._origin.product_qty: - return {'warning': _("By changing this quantity here, you accept the " - "new quantity as complete: Odoo will not " - "automatically generate a back order.")} + warning_mess = { + 'title': _('Quantity decreased!'), + 'message' : _("By changing this quantity here, you accept the " + "new quantity as complete: Odoo will not " + "automatically generate a back order."), + } + return {'warning': warning_mess} @api.onchange('product_id') def onchange_product_id(self):