[FIX] stock: untranslated errors

Closes #17277
This commit is contained in:
Yenthe V.G
2017-05-29 16:56:11 +02:00
committed by Martin Trigaux
parent 02f05e9fef
commit 42a3c66424
2 changed files with 21 additions and 3 deletions
+18
View File
@@ -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"
+3 -3
View File
@@ -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 = []