Commit b564eb25 authored by Vincent Pelletier's avatar Vincent Pelletier

Split up _getOmitQuery to be able to access the ommit switches.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15860 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 121b25fa
......@@ -319,12 +319,18 @@ class SimulationTool(BaseTool):
return simulation_dict
def _getOmitQuery(self, query_table=None, omit_input=0, omit_output=0, **kw):
omit_dict = self._getOmitDict(omit_input=omit_input, omit_output=omit_output)
return self._buildOmitQuery(query_table=query_table, omit_dict=omit_dict)
def _buildOmitQuery(self, query_table, omit_dict):
"""
Build a specific query in order to take:
- negatives quantity values if omit_input
- postives quantity values if omit_output
"""
omit_query = None
omit_input = omit_dict.get('input', False)
omit_output = omit_dict.get('output', False)
if omit_input or omit_output:
# Make sure to check some conditions
condition_expression = \
......@@ -350,6 +356,9 @@ class SimulationTool(BaseTool):
return omit_query
def _getOmitDict(self, omit_input=False, omit_output=False):
return {'input': omit_input, 'output': omit_output}
def _generateSQLKeywordDict(self, table='stock', **kw):
sql_kw, new_kw = self._generateKeywordDict(table=table, **kw)
return self._generateSQLKeywordDictFromKeywordDict(table=table,
......
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