[ADD] patch till 3528e804de50f0112315e23b65066ff752a3f7b2
This commit is contained in:
parent
973d6f5003
commit
48803ecd0e
@ -264,12 +264,12 @@ class StockQuant(models.Model):
|
|||||||
# if we want to reserve
|
# 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)
|
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:
|
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:
|
elif float_compare(quantity, 0, precision_rounding=rounding) < 0:
|
||||||
# if we want to unreserve
|
# if we want to unreserve
|
||||||
available_quantity = sum(quants.mapped('reserved_quantity'))
|
available_quantity = sum(quants.mapped('reserved_quantity'))
|
||||||
if float_compare(abs(quantity), available_quantity, precision_rounding=rounding) > 0:
|
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:
|
else:
|
||||||
return reserved_quants
|
return reserved_quants
|
||||||
|
|
||||||
|
@ -708,11 +708,31 @@ class Warehouse(models.Model):
|
|||||||
|
|
||||||
def _get_sequence_values(self):
|
def _get_sequence_values(self):
|
||||||
return {
|
return {
|
||||||
'in_type_id': {'name': self.name + ' ' + _('Sequence in'), 'prefix': self.code + '/IN/', 'padding': 5},
|
'in_type_id': {
|
||||||
'out_type_id': {'name': self.name + ' ' + _('Sequence out'), 'prefix': self.code + '/OUT/', 'padding': 5},
|
'name': self.name + ' ' + _('Sequence in'),
|
||||||
'pack_type_id': {'name': self.name + ' ' + _('Sequence packing'), 'prefix': self.code + '/PACK/', 'padding': 5},
|
'prefix': self.code + '/IN/', 'padding': 5,
|
||||||
'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},
|
},
|
||||||
|
'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):
|
def _format_rulename(self, from_loc, dest_loc, suffix):
|
||||||
|
Loading…
Reference in New Issue
Block a user