Commit 579c45ff authored by Jérome Perrin's avatar Jérome Perrin

Add getAvailableInventoryList and getAvailableInventoryStat;

Bug fix getAvailableInventoryAssetPrice that was using wrong simulation states;


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6764 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a1d9395f
...@@ -538,6 +538,17 @@ class SimulationTool (BaseTool): ...@@ -538,6 +538,17 @@ class SimulationTool (BaseTool):
kw['simulation_state'] = self.getPortalCurrentInventoryStateList() kw['simulation_state'] = self.getPortalCurrentInventoryStateList()
return self.getInventoryList(**kw) return self.getInventoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation,
'getAvailableInventoryList')
def getAvailableInventoryList(self, **kw):
"""
Returns list of current inventory grouped by section or site
"""
kw['simulation_state'] = tuple(
list(self.getPortalReservedInventoryStateList()) + \
list(self.getPortalCurrentInventoryStateList()))
return self.getInventoryList(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getFutureInventoryList') 'getFutureInventoryList')
def getFutureInventoryList(self, **kw): def getFutureInventoryList(self, **kw):
...@@ -580,6 +591,17 @@ class SimulationTool (BaseTool): ...@@ -580,6 +591,17 @@ class SimulationTool (BaseTool):
kw['simulation_state'] = self.getPortalCurrentInventoryStateList() kw['simulation_state'] = self.getPortalCurrentInventoryStateList()
return self.getInventoryStat(**kw) return self.getInventoryStat(**kw)
security.declareProtected(Permissions.AccessContentsInformation,
'getAvailableInventoryStat')
def getAvailableInventoryStat(self, **kw):
"""
Returns statistics of current inventory grouped by section or site
"""
kw['simulation_state'] = tuple(
list(self.getPortalReservedInventoryStateList()) + \
list(self.getPortalCurrentInventoryStateList()))
return self.getInventoryStat(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getFutureInventoryStat') 'getFutureInventoryStat')
def getFutureInventoryStat(self, **kw): def getFutureInventoryStat(self, **kw):
...@@ -675,7 +697,9 @@ class SimulationTool (BaseTool): ...@@ -675,7 +697,9 @@ class SimulationTool (BaseTool):
Returns list of available inventory grouped by section or site Returns list of available inventory grouped by section or site
(current inventory - deliverable) (current inventory - deliverable)
""" """
kw['simulation_state'] = self.getPortalCurrentInventoryStateList() kw['simulation_state'] = tuple(
list(self.getPortalReservedInventoryStateList()) + \
list(self.getPortalCurrentInventoryStateList()))
return self.getInventoryAssetPrice(**kw) return self.getInventoryAssetPrice(**kw)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
......
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