Commit 7698284f authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5.Tool.SimulationTool: Wrap SQL before passing it to ComplexQuery.

Also, do not use deprecated parameter name to pass a logical operator.
parent c0856b9a
...@@ -46,7 +46,7 @@ from Products.ERP5 import DeliverySolver ...@@ -46,7 +46,7 @@ from Products.ERP5 import DeliverySolver
from Products.ERP5 import TargetSolver from Products.ERP5 import TargetSolver
from Products.PythonScripts.Utility import allow_class from Products.PythonScripts.Utility import allow_class
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery, SimpleQuery from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery, SimpleQuery, SQLQuery
from Shared.DC.ZRDB.Results import Results from Shared.DC.ZRDB.Results import Results
from Products.ERP5Type.Utils import mergeZRDBResults from Products.ERP5Type.Utils import mergeZRDBResults
...@@ -464,14 +464,14 @@ class SimulationTool(BaseTool): ...@@ -464,14 +464,14 @@ class SimulationTool(BaseTool):
if simulation_query is not None: if simulation_query is not None:
query_list.append(simulation_query) query_list.append(simulation_query)
return ComplexQuery( return ComplexQuery(
"%(query_table)s.node_uid <> %(query_table)s.mirror_node_uid " SQLQuery("%(query_table)s.node_uid <> %(query_table)s.mirror_node_uid "
"OR %(query_table)s.section_uid <> %(query_table)s.mirror_section_uid " "OR %(query_table)s.section_uid <> %(query_table)s.mirror_section_uid "
"OR %(query_table)s.mirror_node_uid IS NULL " "OR %(query_table)s.mirror_node_uid IS NULL "
"OR %(query_table)s.mirror_section_uid IS NULL " "OR %(query_table)s.mirror_section_uid IS NULL "
"OR %(query_table)s.payment_uid IS NOT NULL" % { "OR %(query_table)s.payment_uid IS NOT NULL" % {
'query_table': table, 'query_table': table,
}, }),
operator='AND', logical_operator='AND',
*query_list *query_list
) )
return simulation_query return simulation_query
......
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