Commit 33735f86 authored by Romain Courteaud's avatar Romain Courteaud

Calculate container total quantity with python, instead of sql.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16746 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c438ba2e
......@@ -104,8 +104,16 @@ class PackingList(Delivery):
for movement in self.getMovementList():
quantity = movement.getQuantity()
# XXX FIXME: script name hardcoded
packed_quantity = movement.Movement_getPackedQuantity()
query_kw = {
'portal_type': self.getPortalContainerLineTypeList(),
'movement.explanation_uid': self.getUid(),
'movement.resource_uid': movement.getResourceUid(),
'movement.variation_text': movement.getVariationText(),
'has_cell_content': 0,
}
container_mvt_list = self.portal_catalog(**query_kw)
packed_quantity = sum([x.quantity for x in container_mvt_list \
if x.quantity is not None])
if quantity != packed_quantity:
return 0
......
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