Commit 8ffb3416 authored by Vincent Pelletier's avatar Vincent Pelletier

Instead of building by hand a query and calling it, it's simpler to use...

Instead of building by hand a query and calling it, it's simpler to use buildSQLQuery while making sure that it won't join with any table.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24944 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c0aee92
......@@ -961,16 +961,14 @@ class SimulationTool(BaseTool):
where_expression = None
if len(date_value_list) == 1:
date = date_value_list[0]
if isinstance(date, DateTime):
date = date.toZone('UTC').ISO()
# build a query for date to take range into account
date_query_kw = {"inventory.date" : date,
"operator" : column_value_dict.get('date', {}).get('operator', []),
"range" : column_value_dict.get('date', {}).get('range', []),
}
date_query = Query(**date_query_kw)
date_query_result = date_query()
date_query_result = self.getPortalObject().portal_catalog.buildSQLQuery(**{
'inventory.date': {
'query': date,
'range': column_value_dict.get('date', {}).get('range', [])
},
'query_table': None,
})
if date_query_result['where_expression'] not in ('',None):
where_expression = date_query_result['where_expression']
elif len(date_value_list) > 1:
......
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