Commit 0c468667 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Cédric Le Ninivin

erp5_base: check force create even if total quantity is 0

maybe just use property of delivery instead of script
parent 7e94031c
...@@ -902,9 +902,16 @@ class BuilderMixin(XMLObject, Amount, Predicate): ...@@ -902,9 +902,16 @@ class BuilderMixin(XMLObject, Amount, Predicate):
# if total quantity is 0 no need to create anything # if total quantity is 0 no need to create anything
total_quantity = 0 total_quantity = 0
for movement in movement_group_node.getMovementList(): movement_list = movement_group_node.getMovementList()
for movement in movement_list:
total_quantity += abs(movement.getQuantity()) total_quantity += abs(movement.getQuantity())
if total_quantity == 0:
force_create = False
check_force_method = getattr(self, 'Delivery_isForceCreate', None)
if check_force_method:
force_create = check_force_method(movement_list)
if total_quantity == 0 and (not force_create):
return delivery_list return delivery_list
delivery = self._createDelivery(delivery_module, delivery = self._createDelivery(delivery_module,
......
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