[FIX] sale_stock: UoM in warning

The warning message of the product packaging change does not take into
account the appropriate UoM.

opw-12827
Fixes #12827
This commit is contained in:
Nicolas Martinelli 2016-07-28 13:13:00 +02:00
parent 8ceb9438d1
commit f57f55966d
2 changed files with 4 additions and 3 deletions

View File

@ -349,7 +349,7 @@ msgstr ""
#. module: sale_stock
#: code:addons/sale_stock/sale_stock.py:270
#, python-format
msgid "You selected a quantity of %d Units.\n"
msgid "You selected a quantity of %s %s.\n"
"But it's not compatible with the selected packaging.\n"
"Here is a proposition of quantities according to the packaging:\n"
"EAN: %s Quantity: %s Type of ul: %s"

View File

@ -260,11 +260,12 @@ class sale_order_line(osv.osv):
qty_pack = pack.qty
type_ul = pack.ul
if not warning_msgs:
warn_msg = _("You selected a quantity of %d Units.\n"
uom_obj = product_uom_obj.browse(cr, uid, uom, context=context)
warn_msg = _("You selected a quantity of %s %s.\n"
"But it's not compatible with the selected packaging.\n"
"Here is a proposition of quantities according to the packaging:\n"
"EAN: %s Quantity: %s Type of ul: %s") % \
(qty, ean, qty_pack, type_ul.name)
(qty, uom_obj.name, ean, qty_pack, type_ul.name)
warning_msgs += _("Picking Information ! : ") + warn_msg + "\n\n"
warning = {
'title': _('Configuration Error!'),