Commit 8d8a3cbf authored by Alexandre Boeglin's avatar Alexandre Boeglin

Using GROUP_BY in the query might return multiple lines.

getInventory must return the total sum.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3246 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 26497870
......@@ -492,9 +492,13 @@ class SimulationTool (BaseTool):
if src__ :
return result
if len(result) > 0 and result[0].inventory is not None :
return result[0].inventory
return 0.0
total_result = 0.0
if len(result) > 0:
for result_line in result:
if result_line.inventory is not None:
total_result += result_line.inventory
return total_result
security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentInventory')
def getCurrentInventory(self, **kw):
......
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