Don't raise an Access error if the quantity to save is greater than the one assigned.

Task #066882
This commit is contained in:
Juanjo Garcia 2022-10-04 12:34:32 +02:00
parent 90dd8324d7
commit 298e3ab2f2
1 changed files with 0 additions and 16 deletions

View File

@ -102,22 +102,6 @@ class Move(metaclass=PoolMeta):
query = table.select(table.id, where=sql_where)
return [('id', 'in', query)]
@classmethod
def write(cls, *args):
actions = iter(args)
for moves, values in zip(actions, actions):
# Ensure quantity is not set to a value greater than the one
# assigned, given that we remove 'quantity' from
# cls._deny_modify_assigned in __setup__
if 'quantity' in values:
for move in moves:
if (move.state == 'assigned'
and float(values['quantity']) > move.quantity):
raise AccessError(
gettext('stock.msg_move_modify_assigned',
move=move.rec_name))
super(Move, cls).write(*args)
@classmethod
def copy(cls, moves, default=None):
if default is None: