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): ...@@ -613,16 +613,24 @@ class SimulationTool (BaseTool):
Same thing as getInventory but returns an asset Same thing as getInventory but returns an asset
price rather than an inventory. price rather than an inventory.
NOTE: implementation could be merged with getInventory
""" """
sql_kw = self._generateSQLKeywordDict(**kw) sql_kw = self._generateSQLKeywordDict(**kw)
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)
if src__ :
return result
return self.Resource_zGetInventoryAssetPrice( total_result = 0.0
src__=src__, ignore_variation=ignore_variation, if len(result) > 0:
standardise=standardise, omit_simulation=omit_simulation, for result_line in result:
omit_input=omit_input, omit_output=omit_output, if result_line.inventory is not None:
selection_domain=selection_domain, total_result += result_line.total_price
selection_report=selection_report, **sql_kw)
return total_result
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getCurrentInventoryAssetPrice') '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