Commit 2eb77cb9 authored by Rafael Monnerat's avatar Rafael Monnerat

master: Compatibility with operator was dropped from catalog

  Reference commit nexedi/erp5@455b24e5
parent ff951e30
...@@ -20,7 +20,7 @@ select_kw.update( ...@@ -20,7 +20,7 @@ select_kw.update(
select_dict=select_dict, select_dict=select_dict,
left_join_list=select_dict.keys(), left_join_list=select_dict.keys(),
default_aggregate_portal_type=ComplexQuery(NegatedQuery(Query(default_aggregate_portal_type='Computer')), default_aggregate_portal_type=ComplexQuery(NegatedQuery(Query(default_aggregate_portal_type='Computer')),
Query(default_aggregate_portal_type=None), operator="OR"), Query(default_aggregate_portal_type=None),logical_operator="OR"),
grouping_reference=None, grouping_reference=None,
sort_on=(('modification_date', 'ASC'),) # the highest chance to find movement which can be delivered sort_on=(('modification_date', 'ASC'),) # the highest chance to find movement which can be delivered
) )
......
...@@ -79,7 +79,7 @@ def getUserByLogin(portal, login): ...@@ -79,7 +79,7 @@ def getUserByLogin(portal, login):
person_query = Query(portal_type=["Person"], person_query = Query(portal_type=["Person"],
reference=dict(query=login, key='ExactMatch')) reference=dict(query=login, key='ExactMatch'))
result = portal.portal_catalog.unrestrictedSearchResults( result = portal.portal_catalog.unrestrictedSearchResults(
query=ComplexQuery(machine_query, person_query, operator="OR"), query=ComplexQuery(machine_query, person_query,logical_operator="OR"),
select_expression='reference') select_expression='reference')
result = [x for x in result if \ result = [x for x in result if \
(x.getPortalType() == 'Person' and x.getValidationState() != 'deleted') or \ (x.getPortalType() == 'Person' and x.getValidationState() != 'deleted') or \
......
...@@ -90,7 +90,7 @@ def getUserByLogin(portal, login): ...@@ -90,7 +90,7 @@ def getUserByLogin(portal, login):
person_query = Query(portal_type=["Person"], person_query = Query(portal_type=["Person"],
reference=dict(query=login, key='ExactMatch')) reference=dict(query=login, key='ExactMatch'))
result = portal.portal_catalog.unrestrictedSearchResults( result = portal.portal_catalog.unrestrictedSearchResults(
query=ComplexQuery(machine_query, person_query, operator="OR"), query=ComplexQuery(machine_query, person_query,logical_operator="OR"),
select_expression='reference') select_expression='reference')
result = [x for x in result if \ result = [x for x in result if \
(x.getPortalType() == 'Person' and x.getValidationState() != 'deleted') or \ (x.getPortalType() == 'Person' and x.getValidationState() != 'deleted') or \
......
...@@ -533,7 +533,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -533,7 +533,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
default_aggregate_uid=ComplexQuery( default_aggregate_uid=ComplexQuery(
Query(default_aggregate_uid=sequence['computer_partition_uid']), Query(default_aggregate_uid=sequence['computer_partition_uid']),
Query(default_aggregate_uid=sequence['software_instance_uid']), Query(default_aggregate_uid=sequence['software_instance_uid']),
operator="AND"), logical_operator="AND"),
portal_type=self.sale_packing_list_line_portal_type, portal_type=self.sale_packing_list_line_portal_type,
simulation_state=state, simulation_state=state,
resource_relative_url=resource)[0][0]) resource_relative_url=resource)[0][0])
...@@ -2834,7 +2834,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -2834,7 +2834,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
query = ComplexQuery( query = ComplexQuery(
Query(aggregate_uid=sequence['computer_partition_uid']), Query(aggregate_uid=sequence['computer_partition_uid']),
Query(aggregate_portal_type=self.software_instance_portal_type), Query(aggregate_portal_type=self.software_instance_portal_type),
operator="AND") logical_operator="AND")
software_instance = self.portal.portal_catalog.getResultValue( software_instance = self.portal.portal_catalog.getResultValue(
portal_type="Sale Packing List Line", portal_type="Sale Packing List Line",
sort_on=(('movement.start_date', 'DESC'),), sort_on=(('movement.start_date', 'DESC'),),
...@@ -2845,7 +2845,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -2845,7 +2845,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
query = ComplexQuery( query = ComplexQuery(
Query(aggregate_uid=sequence['computer_partition_uid']), Query(aggregate_uid=sequence['computer_partition_uid']),
Query(aggregate_portal_type=self.slave_instance_portal_type), Query(aggregate_portal_type=self.slave_instance_portal_type),
operator="AND") logical_operator="AND")
slave_instance = self.portal.portal_catalog.getResultValue( slave_instance = self.portal.portal_catalog.getResultValue(
portal_type="Sale Packing List Line", portal_type="Sale Packing List Line",
query=query).getAggregateValue(portal_type=self.slave_instance_portal_type) query=query).getAggregateValue(portal_type=self.slave_instance_portal_type)
......
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