Commit 8739cb72 authored by Sebastien Robin's avatar Sebastien Robin

Revert the previous commit and fixed the problem found on dates.

The at_date parameter must be in both the where expression and
in pamaters given to the zsql methods.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14027 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f477f75f
...@@ -1059,6 +1059,14 @@ class SimulationTool(BaseTool): ...@@ -1059,6 +1059,14 @@ class SimulationTool(BaseTool):
""" """
new_kw = self._generateSQLKeywordDict(table='item',strict_simulation_state=strict_simulation_state,**kw) new_kw = self._generateSQLKeywordDict(table='item',strict_simulation_state=strict_simulation_state,**kw)
at_date = kw.get('at_date',None)
if at_date is not None:
from Products.ZSQLCatalog.SQLCatalog import QueryMixin
query_mixin = QueryMixin()
at_date = query_mixin._quoteSQLString(at_date)
# Do not remove at_date in new_kw, it is required in
# order to do a "select item left join item on date"
new_kw['at_date'] = at_date
# Extra parameters for the SQL Method # Extra parameters for the SQL Method
new_kw['join_on_item'] = new_kw.get('at_date') or \ new_kw['join_on_item'] = new_kw.get('at_date') or \
......
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