diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index d3a06ce060f..559aa1d3b85 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -15,6 +15,22 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: stock +#: code:addons/stock/models/stock_move.py:230 +#, python-format +msgid "\n" +"\n" +"%s --> Product UoM is %s (%s) - Move UoM is %s (%s)" +msgstr "" + +#. module: stock +#: code:addons/stock/models/stock_move.py:231 +#, python-format +msgid "\n" +"\n" +"Blocking: %s" +msgstr "" + #. module: stock #: model:ir.model.fields,help:stock.field_stock_config_settings_module_stock_dropshipping msgid "\n" diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 719bf08ea1a..2cd17da87ed 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -223,10 +223,12 @@ class StockMove(models.Model): @api.constrains('product_uom') def _check_uom(self): - moves_error = self.filtered(lambda move: move.product_id.uom_id.category_id.id != move.product_uom.category_id.id) + moves_error = self.filtered(lambda move: move.product_id.uom_id.category_id != move.product_uom.category_id) if moves_error: user_warning = _('You try to move a product using a UoM that is not compatible with the UoM of the product moved. Please use an UoM in the same UoM category.') - user_warning += '\n\nBlocking: %s' % ' ,'.join(moves_error.mapped('name')) + for move in moves_error: + user_warning += _('\n\n%s --> Product UoM is %s (%s) - Move UoM is %s (%s)') % (move.product_id.display_name, move.product_id.uom_id.name, move.product_id.uom_id.category_id.name, move.product_uom.name, move.product_uom.category_id.name) + user_warning += _('\n\nBlocking: %s') % ' ,'.join(moves_error.mapped('name')) raise UserError(user_warning) @api.model_cr