From 42a3c6642480f9cfcc135211f6f8a8634dd950a7 Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Mon, 29 May 2017 16:24:34 +0200 Subject: [PATCH] [FIX] stock: untranslated errors Closes #17277 --- addons/stock/i18n/stock.pot | 18 ++++++++++++++++++ addons/stock/models/product.py | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index c1ef8e47db4..d0c4ce258b1 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -2528,6 +2528,24 @@ msgstr "" msgid "Internal reference number in case it differs from the manufacturer's lot/serial number" msgstr "" +#. module: stock +#: code:addons/stock/models/product.py:257 +#, python-format +msgid "Invalid domain left operand %s" +msgstr "" + +#. module: stock +#: code:addons/stock/models/product.py:259 +#, python-format +msgid "Invalid domain operator %s" +msgstr "" + +#. module: stock +#: code:addons/stock/models/product.py:261 +#, python-format +msgid "Invalid domain right operand %s" +msgstr "" + #. module: stock #: model:ir.model.fields,field_description:stock.field_stock_inventory_category_id msgid "Inventoried Category" diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index cee32361ba4..b48d4f8570d 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -254,11 +254,11 @@ class Product(models.Model): # TDE FIXME: should probably clean the search methods # to prevent sql injections if field not in ('qty_available', 'virtual_available', 'incoming_qty', 'outgoing_qty'): - raise UserError('Invalid domain left operand') + raise UserError(_('Invalid domain left operand %s') % field) if operator not in ('<', '>', '=', '!=', '<=', '>='): - raise UserError('Invalid domain operator') + raise UserError(_('Invalid domain operator %s') % operator) if not isinstance(value, (float, int)): - raise UserError('Invalid domain right operand') + raise UserError(_('Invalid domain right operand %s') % value) # TODO: Still optimization possible when searching virtual quantities ids = []