Commit 56b4b95e authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_item: Update quantity unconditionally

Since Movement_isQuantityEditable does not say anything about Item related
movements, there is no reason to use any condition while updating
quantities.
parent 91619838
...@@ -80,13 +80,11 @@ for line in kw.get('listbox'): ...@@ -80,13 +80,11 @@ for line in kw.get('listbox'):
movement_to_update.getAggregateValueList() + [item]) movement_to_update.getAggregateValueList() + [item])
update_quantity = not context.Movement_isQuantityEditable() if context.isMovement():
if update_quantity:
if context.isMovement():
movement_list = context, movement_list = context,
else: else:
movement_list = context.getCellValueList(base_id='movement') movement_list = context.getCellValueList(base_id='movement')
for movement in movement_list: for movement in movement_list:
quantity = 0 quantity = 0
item_list = movement.getAggregateValueList() item_list = movement.getAggregateValueList()
for item in item_list: for item in item_list:
......
...@@ -92,13 +92,11 @@ for item_uid in uids: ...@@ -92,13 +92,11 @@ for item_uid in uids:
movement_to_update.setAggregateValueSet( movement_to_update.setAggregateValueSet(
movement_to_update.getAggregateValueList() + [item]) movement_to_update.getAggregateValueList() + [item])
update_quantity = not context.Movement_isQuantityEditable() if context.isMovement():
if update_quantity:
if context.isMovement():
movement_list = context, movement_list = context,
else: else:
movement_list = context.getCellValueList(base_id='movement') movement_list = context.getCellValueList(base_id='movement')
for movement in movement_list: for movement in movement_list:
quantity = 0 quantity = 0
item_list = movement.getAggregateValueList() item_list = movement.getAggregateValueList()
for item in item_list: for item in item_list:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment