Commit 6ac4d4c8 authored by Jérome Perrin's avatar Jérome Perrin

possible API extension to support inventory API on all movements

(requires to add an is_accountable column in stock table
and add some <dtml-if only_accountable> AND stock.is_accountable </dtml-if> in
Resource_zGet* skins)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45758 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 86ef0009
......@@ -1021,6 +1021,10 @@ class SimulationTool(BaseTool):
omit_simulation - doesn't take into account simulation movements
only_accountable - Only take into account accountable movements. By
default, only movements for which isAccountable() is
true will be taken into account.
omit_input - doesn't take into account movement with quantity > 0
omit_output - doesn't take into account movement with quantity < 0
......@@ -1180,6 +1184,7 @@ class SimulationTool(BaseTool):
def getInventoryList(self, src__=0, optimisation__=True,
ignore_variation=0, standardise=0,
omit_simulation=0,
only_accountable=True,
default_stock_table='stock',
selection_domain=None, selection_report=None,
statistic=0, inventory_list=1,
......@@ -1412,6 +1417,7 @@ class SimulationTool(BaseTool):
stock_table_id=EQUAL_DATE_TABLE_ID,
src__=src__, ignore_variation=ignore_variation,
standardise=standardise, omit_simulation=omit_simulation,
only_accountable=only_accountable,
selection_domain=selection_domain,
selection_report=selection_report, precision=precision,
inventory_list=inventory_list,
......@@ -1424,6 +1430,7 @@ class SimulationTool(BaseTool):
stock_table_id=GREATER_THAN_DATE_TABLE_ID,
src__=src__, ignore_variation=ignore_variation,
standardise=standardise, omit_simulation=omit_simulation,
only_accountable=only_accountable,
selection_domain=selection_domain,
selection_report=selection_report, precision=precision,
inventory_list=inventory_list,
......@@ -1551,6 +1558,7 @@ class SimulationTool(BaseTool):
stock_table_id=default_stock_table,
src__=src__, ignore_variation=ignore_variation,
standardise=standardise, omit_simulation=omit_simulation,
only_accountable=only_accountable,
selection_domain=selection_domain,
selection_report=selection_report, precision=precision,
inventory_list=inventory_list, connection_id=connection_id,
......@@ -1832,7 +1840,8 @@ class SimulationTool(BaseTool):
security.declareProtected(Permissions.AccessContentsInformation,
'getInventoryHistoryList')
def getInventoryHistoryList(self, src__=0, ignore_variation=0,
standardise=0, omit_simulation=0, omit_input=0,
standardise=0, omit_simulation=0,
only_accountable=True, omit_input=0,
omit_output=0, selection_domain=None,
selection_report=None, precision=None, **kw):
"""
......@@ -1848,6 +1857,7 @@ class SimulationTool(BaseTool):
return self.Resource_getInventoryHistoryList(
src__=src__, ignore_variation=ignore_variation,
standardise=standardise, omit_simulation=omit_simulation,
only_accountable=only_accountable,
omit_input=omit_input, omit_output=omit_output,
selection_domain=selection_domain,
selection_report=selection_report, precision=precision,
......@@ -1857,6 +1867,7 @@ class SimulationTool(BaseTool):
'getInventoryHistoryChart')
def getInventoryHistoryChart(self, src__=0, ignore_variation=0,
standardise=0, omit_simulation=0,
only_accountable=True,
omit_input=0, omit_output=0,
selection_domain=None,
selection_report=None, precision=None, **kw):
......@@ -1872,6 +1883,7 @@ class SimulationTool(BaseTool):
return self.Resource_getInventoryHistoryChart(
src__=src__, ignore_variation=ignore_variation,
standardise=standardise, omit_simulation=omit_simulation,
only_accountable=only_accountable,
omit_input=omit_input, omit_output=omit_output,
selection_domain=selection_domain,
selection_report=selection_report, precision=precision,
......@@ -1882,6 +1894,7 @@ class SimulationTool(BaseTool):
def getMovementHistoryList(self, src__=0, ignore_variation=0,
standardise=0, omit_simulation=0,
omit_input=0, omit_output=0,
only_accountable=True,
omit_asset_increase=0, omit_asset_decrease=0,
selection_domain=None, selection_report=None,
initial_running_total_quantity=0,
......@@ -1901,6 +1914,7 @@ class SimulationTool(BaseTool):
src__=src__, ignore_variation=ignore_variation,
standardise=standardise,
omit_simulation=omit_simulation,
only_accountable=only_accountable,
omit_input=omit_input, omit_output=omit_output,
omit_asset_increase=omit_asset_increase,
omit_asset_decrease=omit_asset_decrease,
......@@ -1915,7 +1929,8 @@ class SimulationTool(BaseTool):
security.declareProtected(Permissions.AccessContentsInformation,
'getMovementHistoryStat')
def getMovementHistoryStat(self, src__=0, ignore_variation=0,
standardise=0, omit_simulation=0, omit_input=0,
standardise=0, omit_simulation=0,
only_accountable=True, omit_input=0,
omit_output=0, selection_domain=None,
selection_report=None, precision=None, **kw):
"""
......@@ -1925,9 +1940,10 @@ class SimulationTool(BaseTool):
sql_kw = self._generateSQLKeywordDict(**kw)
return 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, precision=precision, **sql_kw)
omit_simulation=omit_simulation, only_accountable=only_accountable,
omit_input=omit_input, omit_output=omit_output,
selection_domain=selection_domain, selection_report=selection_report,
precision=precision, **sql_kw)
security.declareProtected(Permissions.AccessContentsInformation,
'getNextNegativeInventoryDate')
......
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