diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 95d183a2..9989a94f 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -264,12 +264,12 @@ class StockQuant(models.Model): # if we want to reserve available_quantity = self._get_available_quantity(product_id, location_id, lot_id=lot_id, package_id=package_id, owner_id=owner_id, strict=strict) if float_compare(quantity, available_quantity, precision_rounding=rounding) > 0: - raise UserError(_('It is not possible to reserve more products of %s than you have in stock.') % (', '.join(quants.mapped('product_id').mapped('display_name')))) + raise UserError(_('It is not possible to reserve more products of %s than you have in stock.') % product_id.display_name) elif float_compare(quantity, 0, precision_rounding=rounding) < 0: # if we want to unreserve available_quantity = sum(quants.mapped('reserved_quantity')) if float_compare(abs(quantity), available_quantity, precision_rounding=rounding) > 0: - raise UserError(_('It is not possible to unreserve more products of %s than you have in stock.') % (', '.join(quants.mapped('product_id').mapped('display_name')))) + raise UserError(_('It is not possible to unreserve more products of %s than you have in stock.') % product_id.display_name) else: return reserved_quants diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py index 9d90331d..d5bd44a5 100644 --- a/addons/stock/models/stock_warehouse.py +++ b/addons/stock/models/stock_warehouse.py @@ -708,11 +708,31 @@ class Warehouse(models.Model): def _get_sequence_values(self): return { - 'in_type_id': {'name': self.name + ' ' + _('Sequence in'), 'prefix': self.code + '/IN/', 'padding': 5}, - 'out_type_id': {'name': self.name + ' ' + _('Sequence out'), 'prefix': self.code + '/OUT/', 'padding': 5}, - 'pack_type_id': {'name': self.name + ' ' + _('Sequence packing'), 'prefix': self.code + '/PACK/', 'padding': 5}, - 'pick_type_id': {'name': self.name + ' ' + _('Sequence picking'), 'prefix': self.code + '/PICK/', 'padding': 5}, - 'int_type_id': {'name': self.name + ' ' + _('Sequence internal'), 'prefix': self.code + '/INT/', 'padding': 5}, + 'in_type_id': { + 'name': self.name + ' ' + _('Sequence in'), + 'prefix': self.code + '/IN/', 'padding': 5, + 'company_id': self.company_id.id, + }, + 'out_type_id': { + 'name': self.name + ' ' + _('Sequence out'), + 'prefix': self.code + '/OUT/', 'padding': 5, + 'company_id': self.company_id.id, + }, + 'pack_type_id': { + 'name': self.name + ' ' + _('Sequence packing'), + 'prefix': self.code + '/PACK/', 'padding': 5, + 'company_id': self.company_id.id, + }, + 'pick_type_id': { + 'name': self.name + ' ' + _('Sequence picking'), + 'prefix': self.code + '/PICK/', 'padding': 5, + 'company_id': self.company_id.id, + }, + 'int_type_id': { + 'name': self.name + ' ' + _('Sequence internal'), + 'prefix': self.code + '/INT/', 'padding': 5, + 'company_id': self.company_id.id, + }, } def _format_rulename(self, from_loc, dest_loc, suffix):