summaryrefslogtreecommitdiff
path: root/addons/mrp/wizard
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-06-15 15:16:16 +0200
committerMartin Trigaux <mat@odoo.com>2020-06-18 13:03:34 +0200
commit80e97e98ce76067db1079af8feeef667cfadf837 (patch)
treee261d34e3f8458bd99011f60f508bcce2c723baf /addons/mrp/wizard
parent4a92a183e8631512a8b018eedaf9bf4956ca85e9 (diff)
[IMP] *: use named placeholders in translated message
When more than one parameter is present in a message, it helps the translation to use named placeholder. This way, the order can be changed. It also helps the comprehension of the message.
Diffstat (limited to 'addons/mrp/wizard')
-rw-r--r--addons/mrp/wizard/change_production_qty.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
index 29657577a4f..cd82ca389f6 100644
--- a/addons/mrp/wizard/change_production_qty.py
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -48,7 +48,11 @@ class ChangeProductionQty(models.TransientModel):
produced = sum(production.move_finished_ids.filtered(lambda m: m.product_id == production.product_id).mapped('quantity_done'))
if wizard.product_qty < produced:
format_qty = '%.{precision}f'.format(precision=precision)
- raise UserError(_("You have already processed %s. Please input a quantity higher than %s ") % (format_qty % produced, format_qty % produced))
+ raise UserError(_(
+ "You have already processed %(quantity)s. Please input a quantity higher than %(minimum)s ",
+ quantity=format_qty % produced,
+ minimum=format_qty % produced
+ ))
old_production_qty = production.product_qty
new_production_qty = wizard.product_qty
done_moves = production.move_finished_ids.filtered(lambda x: x.state == 'done' and x.product_id == production.product_id)