Commit bc3c7d45 authored by Jérome Perrin's avatar Jérome Perrin

merge getInventoryAssetPrice with getInventory implementation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5289 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 542cbe87
......@@ -613,16 +613,24 @@ class SimulationTool (BaseTool):
Same thing as getInventory but returns an asset
price rather than an inventory.
NOTE: implementation could be merged with getInventory
"""
sql_kw = self._generateSQLKeywordDict(**kw)
return self.Resource_zGetInventoryAssetPrice(
result = self.Resource_zGetInventory(
src__=src__, ignore_variation=ignore_variation,
standardise=standardise, omit_simulation=omit_simulation,
omit_input=omit_input, omit_output=omit_output,
selection_domain=selection_domain,
selection_report=selection_report, **sql_kw)
selection_domain=selection_domain, selection_report=selection_report,
**sql_kw)
if src__ :
return result
total_result = 0.0
if len(result) > 0:
for result_line in result:
if result_line.inventory is not None:
total_result += result_line.total_price
return total_result
security.declareProtected(Permissions.AccessContentsInformation,
'getCurrentInventoryAssetPrice')
......
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