Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
erp5
Commits
b6f4d46d
Commit
b6f4d46d
authored
Mar 07, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: Stop using ComplexQuery deprecated "operator" argument.
parent
615b6f0c
Changes
32
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
116 additions
and
118 deletions
+116
-118
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.py
...unting/AccountModule_getGeneralLedgerReportSectionList.py
+1
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
...ounting/Account_getNotGroupedAccountingTransactionList.py
+1
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getDetailedAgedBalanceLineList.py
...untingTransactionModule_getDetailedAgedBalanceLineList.py
+1
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.py
...ctionModule_getTransactionLineListForGroupingReference.py
+1
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
...kins/erp5_accounting/Node_getAccountingTransactionList.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/FCKeditor_getDocumentListQuery.py
...m/portal_skins/erp5_dms/FCKeditor_getDocumentListQuery.py
+2
-2
bt5/erp5_jio/SkinTemplateItem/portal_skins/erp5_jio/JIO_class.py
...5_jio/SkinTemplateItem/portal_skins/erp5_jio/JIO_class.py
+4
-4
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/WebSite_getPendingEventInfoList.py
...m/portal_skins/erp5_km/WebSite_getPendingEventInfoList.py
+2
-2
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/ERP5Site_getCategoriesFullPath.py
...l_skins/erp5_ooo_import/ERP5Site_getCategoriesFullPath.py
+1
-1
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_getSelectPaySheetTransactionList.py
...n_fr/DSNMonthlyReport_getSelectPaySheetTransactionList.py
+1
-1
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_psj_crm/testImageRequest.py
...emplateItem/portal_skins/erp5_psj_crm/testImageRequest.py
+1
-1
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_psj_crm/testPageNumberCount.py
...lateItem/portal_skins/erp5_psj_crm/testPageNumberCount.py
+1
-1
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/M0_getImageList.py
...eItem/portal_skins/erp5_registry_ohada/M0_getImageList.py
+1
-1
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/M0_setAssignmentList.py
.../portal_skins/erp5_registry_ohada/M0_setAssignmentList.py
+1
-1
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/P0_setAssignmentList.py
.../portal_skins/erp5_registry_ohada/P0_setAssignmentList.py
+1
-1
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/PersonModule_getBestCandidateList.py
.../erp5_registry_ohada/PersonModule_getBestCandidateList.py
+7
-7
bt5/erp5_registry_ohada/WorkflowTemplateItem/portal_workflow/ohada_form_validation_interaction_workflow/scripts/createPersonFromP0.py
...dation_interaction_workflow/scripts/createPersonFromP0.py
+1
-1
bt5/erp5_registry_ohada/WorkflowTemplateItem/portal_workflow/ohada_form_validation_interaction_workflow/scripts/modifyPhysicalPersonFromP2.py
...nteraction_workflow/scripts/modifyPhysicalPersonFromP2.py
+1
-1
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultModule_getTestPerfResultList.py
...rp5_test_result/TestResultModule_getTestPerfResultList.py
+2
-2
product/ERP5/Document/NodeBudgetVariation.py
product/ERP5/Document/NodeBudgetVariation.py
+3
-3
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+7
-7
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getRelatedDocumentList.py
...tem/portal_skins/erp5_core/Base_getRelatedDocumentList.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_search.py
.../SkinTemplateItem/portal_skins/erp5_core/Folder_search.py
+1
-1
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.py
...catalog/erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.py
+1
-1
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+5
-7
product/ERP5Catalog/tests/testERP5Catalog.py
product/ERP5Catalog/tests/testERP5Catalog.py
+14
-14
product/ERP5Type/patches/WorkflowTool.py
product/ERP5Type/patches/WorkflowTool.py
+5
-5
product/ZSQLCatalog/SearchKey/DateTimeKey.py
product/ZSQLCatalog/SearchKey/DateTimeKey.py
+1
-1
product/ZSQLCatalog/SearchKey/RelatedKey.py
product/ZSQLCatalog/SearchKey/RelatedKey.py
+1
-1
product/ZSQLCatalog/SearchKey/SearchKey.py
product/ZSQLCatalog/SearchKey/SearchKey.py
+1
-1
product/ZSQLCatalog/SearchText/SearchTextParser.py
product/ZSQLCatalog/SearchText/SearchTextParser.py
+44
-44
product/ZSQLCatalog/tests/testSQLCatalog.py
product/ZSQLCatalog/tests/testSQLCatalog.py
+1
-1
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.py
View file @
b6f4d46d
...
...
@@ -101,7 +101,7 @@ if request.get('omit_grouping_reference', False):
params
[
'grouping_query'
]
=
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
params
[
'grouping_reference'
]
=
None
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
View file @
b6f4d46d
...
...
@@ -17,7 +17,7 @@ inventory_query = {
'grouping_query'
:
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
operator
=
"OR"
),
logical_
operator
=
"OR"
),
'simulation_state'
:
params
[
'simulation_state'
],
'node_uid'
:
kw
[
'node_uid'
],
'portal_type'
:
portal
.
getPortalAccountingMovementTypeList
(),
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getDetailedAgedBalanceLineList.py
View file @
b6f4d46d
...
...
@@ -15,7 +15,7 @@ section_uid = portal.Base_getSectionUidListForSectionCategory(
grouping_query
=
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
account_number_memo
=
{}
def
getAccountNumber
(
account_url
):
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.py
View file @
b6f4d46d
...
...
@@ -69,7 +69,7 @@ else:
if
title
:
search_kw
[
'title_query'
]
=
ComplexQuery
(
Query
(
title
=
title
),
Query
(
parent_title
=
title
),
operator
=
'OR'
)
logical_
operator
=
'OR'
)
if
delivery_reference
:
search_kw
[
'parent_reference'
]
=
delivery_reference
if
debit_price
:
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
View file @
b6f4d46d
...
...
@@ -93,7 +93,7 @@ if portal.portal_selections.getSelectionParamsFor(selection_name).get('omit_grou
params
[
'grouping_query'
]
=
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
params
[
'at_date'
],
range
=
"min"
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
params
[
'grouping_reference'
]
=
None
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/FCKeditor_getDocumentListQuery.py
View file @
b6f4d46d
...
...
@@ -11,5 +11,5 @@ return ComplexQuery(
Query
(
validation_state
=
(
'published'
,
'published_alive'
,
'released'
,
'released_alive'
,
'shared'
,
'shared_alive'
),
reference
=
'!=None'
),
Query
(
validation_state
=
'embedded'
,
parent_uid
=
context
.
getUid
()),
operator
=
'or'
),
operator
=
'and'
)
logical_
operator
=
'or'
),
logical_
operator
=
'and'
)
bt5/erp5_jio/SkinTemplateItem/portal_skins/erp5_jio/JIO_class.py
View file @
b6f4d46d
...
...
@@ -367,7 +367,7 @@ class JioGeneric():
try
:
while
True
:
query_dict
[
'query_list'
].
remove
(
None
)
except
ValueError
:
pass
return
ComplexQuery
(
operator
=
query_dict
[
'operator'
],
return
ComplexQuery
(
logical_
operator
=
query_dict
[
'operator'
],
*
query_dict
[
'query_list'
])
return
None
return
rec
(
query_dict
)
...
...
@@ -380,7 +380,7 @@ class JioGeneric():
kw
[
'query'
]
=
ComplexQuery
(
kw
[
'query'
],
ComplexQuery
(
operator
=
'or'
,
logical_
operator
=
'or'
,
*
[
SimpleQuery
(
comparison_operator
=
"="
,
portal_type
=
x
)
\
for
x
in
self
.
allowed_portal_type_list
]
),
...
...
@@ -388,7 +388,7 @@ class JioGeneric():
)
else
:
kw
[
'query'
]
=
ComplexQuery
(
operator
=
'or'
,
logical_
operator
=
'or'
,
*
[
SimpleQuery
(
comparison_operator
=
"="
,
portal_type
=
x
)
\
for
x
in
self
.
allowed_portal_type_list
]
)
...
...
@@ -438,7 +438,7 @@ class JioGeneric():
# editkw['query'] = ComplexQuery(
# editkw['query'],
# ComplexQuery(
# operator='or',
#
logical_
operator='or',
# *[SimpleQuery(comparison_operator="=", portal_type=x) \
# for x in self.allowed_portal_type_list]
# ),
...
...
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/WebSite_getPendingEventInfoList.py
View file @
b6f4d46d
...
...
@@ -30,7 +30,7 @@ for action in ordered_global_action_list:
sub_query_list
=
[]
for
k
,
v
in
query_dict
.
items
():
sub_query_list
.
append
(
Query
(
**
{
k
:
v
}))
complex_query
=
ComplexQuery
(
*
sub_query_list
,
**
dict
(
operator
=
"AND"
)
)
complex_query
=
ComplexQuery
(
logical_operator
=
"AND"
,
*
sub_query_list
)
# add to query filtering by local roles as defined in worklist
complex_query
=
portal
.
portal_catalog
.
getSecurityQuery
(
query
=
complex_query
,
local_roles
=
local_roles
)
query_list
.
append
(
complex_query
)
...
...
@@ -43,7 +43,7 @@ if not query_list:
return
[]
# Invoke catalog
query
=
ComplexQuery
(
*
query_list
,
**
dict
(
operator
=
"OR"
)
)
query
=
ComplexQuery
(
logical_operator
=
"OR"
,
*
query_list
)
#query = portal.portal_catalog.getSecurityQuery(query)
#result_list = portal.portal_catalog(query=query,
# sort_on='modification_date',
...
...
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/ERP5Site_getCategoriesFullPath.py
View file @
b6f4d46d
...
...
@@ -18,7 +18,7 @@ for base_category_name, category in category_dict.items():
key
=
'ExactMatch'
),
Query
(
reference
=
category
,
key
=
'ExactMatch'
),
operator
=
'OR'
),
logical_
operator
=
'OR'
),
ComplexQuery
(
Query
(
relative_url
=
'%s/%%'
%
base_category_name
)))
category_value
=
portal
.
portal_catalog
.
getResultValue
(
query
=
query
)
...
...
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_getSelectPaySheetTransactionList.py
View file @
b6f4d46d
...
...
@@ -11,7 +11,7 @@ catalog_kw = {'query': ComplexQuery(Query(start_date=">=%s" % from_date.strftime
Query
(
stop_date
=
"<=%s"
%
to_date
.
strftime
(
"%Y/%m/%d"
)),
Query
(
destination_trade_uid
=
Query
(
destination_trade_uid
=
destination_trade
.
getUid
())),
Query
(
simulation_state
=
'!=cancelled'
),
operator
=
"AND"
)}
logical_
operator
=
"AND"
)}
paysheet_list
=
portal
.
accounting_module
.
searchFolder
(
portal_type
=
"Pay Sheet Transaction"
,
**
catalog_kw
)
...
...
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_psj_crm/testImageRequest.py
View file @
b6f4d46d
...
...
@@ -19,7 +19,7 @@ query = ComplexQuery(Query(parent_uid=event_uid_list),
Query
(
uid
=
event_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
uid
=
attachment_pdf_uid_list
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
kw
[
'portal_type'
]
=
(
'PDF'
,
'Image'
)
+
context
.
getPortalDocumentTypeList
()
+
context
.
getPortalEventTypeList
()
return
context
.
portal_catalog
(
query
=
query
,
**
kw
)
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_psj_crm/testPageNumberCount.py
View file @
b6f4d46d
...
...
@@ -19,7 +19,7 @@ query = ComplexQuery(Query(parent_uid=event_uid_list),
Query
(
uid
=
event_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
uid
=
attachment_pdf_uid_list
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
kw
[
'portal_type'
]
=
(
'PDF'
)
...
...
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/M0_getImageList.py
View file @
b6f4d46d
...
...
@@ -30,7 +30,7 @@ query = ComplexQuery(Query(parent_uid=event_uid_list),
Query
(
uid
=
event_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
uid
=
attachment_pdf_uid_list
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
kw
[
'portal_type'
]
=
(
'PDF'
)
result_uid
=
[
x
.
getUid
()
for
x
in
context
.
portal_catalog
(
query
=
query
,
**
kw
)]
...
...
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/M0_setAssignmentList.py
View file @
b6f4d46d
...
...
@@ -48,7 +48,7 @@ for item in items:
# query = ComplexQuery(Query(title=person_title),
# Query(birth_date=item['start_date']),
# Query(birthplace_city=item['default_birthplace_address_city']),
# operator="AND")
#
logical_
operator="AND")
# best_candidate_list=list(context.portal_catalog(portal_type='Person',
# query=query))
#verify that the new person is not selected more than once in the fast input
...
...
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/P0_setAssignmentList.py
View file @
b6f4d46d
...
...
@@ -46,7 +46,7 @@ for item in items:
# query = ComplexQuery(Query(title=person_title),
# Query(birth_date=item['start_date']),
# Query(birthplace_city=item['default_birthplace_address_city']),
# operator="AND")
#
logical_
operator="AND")
# best_candidate_list=list(context.portal_catalog(portal_type='Person',
# query=query))
#verify that the new person is not selected more than once in the fast input
...
...
bt5/erp5_registry_ohada/SkinTemplateItem/portal_skins/erp5_registry_ohada/PersonModule_getBestCandidateList.py
View file @
b6f4d46d
...
...
@@ -54,31 +54,31 @@ if person_start_date == None or person_birthplace == None:
Query
(
title
=
person_title_reversed
),
Query
(
title
=
person_first_name
),
Query
(
title
=
person_last_name
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
query
=
ComplexQuery
(
Query
(
title
=
person_title
),
ComplexQuery
(
Query
(
title
=
person_title
),
Query
(
birth_date
=
person_start_date
),
operator
=
"AND"
),
logical_
operator
=
"AND"
),
ComplexQuery
(
Query
(
title
=
person_title
),
Query
(
birthplace_city
=
person_birthplace
),
operator
=
"AND"
),
logical_
operator
=
"AND"
),
ComplexQuery
(
Query
(
birth_date
=
person_start_date
),
Query
(
birthplace_city
=
person_birthplace
),
operator
=
"AND"
),
logical_
operator
=
"AND"
),
ComplexQuery
(
Query
(
title
=
person_title_reversed
),
Query
(
title
=
person_first_name
),
Query
(
title
=
person_last_name
),
operator
=
"OR"
),
logical_
operator
=
"OR"
),
ComplexQuery
(
Query
(
title
=
person_title
),
Query
(
birth_date
=
[
DateTime
(
person_start_date
.
year
(),
1
,
1
),
DateTime
(
person_start_date
.
year
(),
12
,
31
),],
range
=
'minmax'
),
operator
=
"AND"
),
operator
=
"OR"
)
logical_
operator
=
"AND"
),
logical_
operator
=
"OR"
)
select_expression
=
\
"""((title ="%s"))AS result_order
"""
%
(
person_title
)
...
...
bt5/erp5_registry_ohada/WorkflowTemplateItem/portal_workflow/ohada_form_validation_interaction_workflow/scripts/createPersonFromP0.py
View file @
b6f4d46d
...
...
@@ -79,7 +79,7 @@ new_registry_number = request_eform.portal_ids.generateNewId(
query
=
ComplexQuery
(
Query
(
title
=
request_eform
.
getTitle
()),
Query
(
birth_date
=
request_eform
.
getStartDate
()),
Query
(
birthplace_city
=
request_eform
.
getDefaultBirthplaceAddressCity
()),
operator
=
"AND"
)
logical_
operator
=
"AND"
)
person_list
=
[
person
.
getObject
()
for
person
in
person_module
.
searchFolder
(
query
=
query
)]
if
request_eform
.
getBeginning
()
or
request_eform
.
getOpening
():
if
len
(
person_list
)
==
0
:
...
...
bt5/erp5_registry_ohada/WorkflowTemplateItem/portal_workflow/ohada_form_validation_interaction_workflow/scripts/modifyPhysicalPersonFromP2.py
View file @
b6f4d46d
...
...
@@ -49,7 +49,7 @@ request_eform.setTitle(request_eform.getOwnerFirstName()+' '+request_eform.getOw
query
=
ComplexQuery
(
Query
(
title
=
request_eform
.
getTitle
()),
Query
(
birth_date
=
request_eform
.
getOwnerBirthday
()),
Query
(
birthplace_city
=
request_eform
.
getOwnerBirthplace
()),
operator
=
"AND"
)
logical_
operator
=
"AND"
)
person_list
=
[
person
.
getObject
()
for
person
in
\
context
.
portal_catalog
(
portal_type
=
'Person'
,
query
=
query
)]
...
...
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResultModule_getTestPerfResultList.py
View file @
b6f4d46d
...
...
@@ -16,11 +16,11 @@ new_test_result_list = []
context
.
log
(
"rev_query_list"
,
rev_query_list
)
if
rev_query_list
:
result
=
context
.
searchFolder
(
title
=
'PERF-ERP5-MASTER'
,
simulation_state
=
'stopped'
,
revision
=
ComplexQuery
(
operator
=
'AND'
,
*
rev_query_list
),
revision
=
ComplexQuery
(
logical_
operator
=
'AND'
,
*
rev_query_list
),
sort_on
=
((
'delivery.start_date'
,
'ASC'
),),
src__
=
1
)
context
.
log
(
"result"
,
result
)
for
test
in
context
.
searchFolder
(
title
=
'PERF-ERP5-MASTER'
,
simulation_state
=
'stopped'
,
revision
=
ComplexQuery
(
operator
=
'AND'
,
*
rev_query_list
),
revision
=
ComplexQuery
(
logical_
operator
=
'AND'
,
*
rev_query_list
),
sort_on
=
((
'delivery.start_date'
,
'ASC'
),)):
test
=
test
.
getObject
()
if
revision
!=
test
.
getReference
():
...
...
product/ERP5/Document/NodeBudgetVariation.py
View file @
b6f4d46d
...
...
@@ -204,7 +204,7 @@ class NodeBudgetVariation(BudgetVariation):
query
=
ComplexQuery
(
NegatedQuery
(
Query
(
**
{
axis
:
other_uid_list
})),
Query
(
**
{
axis
:
None
}),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
value
=
portal_categories
.
getCategoryValue
(
node_url
,
...
...
@@ -219,7 +219,7 @@ class NodeBudgetVariation(BudgetVariation):
query_dict
[
axis
]
=
ComplexQuery
(
query
,
Query
(
**
{
axis
:
query_dict
[
axis
]}),
operator
=
'OR'
)
logical_
operator
=
'OR'
)
else
:
query_dict
[
axis
]
=
query
...
...
@@ -297,7 +297,7 @@ class NodeBudgetVariation(BudgetVariation):
query_dict
[
axis
]
=
ComplexQuery
(
Query
(
**
{
axis
:
None
}),
Query
(
**
{
axis
:
query_dict
[
axis
]}),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
query_dict
[
axis
]
=
Query
(
**
{
axis
:
None
})
return
query_dict
...
...
product/ERP5/Tool/SimulationTool.py
View file @
b6f4d46d
...
...
@@ -246,7 +246,7 @@ class SimulationTool(BaseTool):
simulation_query
=
ComplexQuery
(
self
.
_getIncreaseQuery
(
table
,
'quantity'
,
True
),
SimpleQuery
(
**
{
table
+
'.simulation_state'
:
input_simulation_state
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
)
output_simulation_state
=
simulation_state_dict
.
get
(
'output_simulation_state'
)
if
output_simulation_state
is
not
None
:
...
...
@@ -255,9 +255,9 @@ class SimulationTool(BaseTool):
ComplexQuery
(
self
.
_getIncreaseQuery
(
table
,
'quantity'
,
False
),
SimpleQuery
(
**
{
table
+
'.simulation_state'
:
output_simulation_state
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
),
operator
=
'OR'
logical_
operator
=
'OR'
)
return
simulation_query
...
...
@@ -378,14 +378,14 @@ class SimulationTool(BaseTool):
ComplexQuery
(
SimpleQuery
(
comparison_operator
=
'<'
,
**
{
table
+
'.'
+
column
:
0
}),
SimpleQuery
(
**
{
table
+
'.is_cancellation'
:
increase
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
),
ComplexQuery
(
SimpleQuery
(
comparison_operator
=
'>='
,
**
{
table
+
'.'
+
column
:
0
}),
SimpleQuery
(
**
{
table
+
'.is_cancellation'
:
not
increase
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
),
operator
=
'OR'
,
logical_
operator
=
'OR'
,
)
def
_generateSQLKeywordDict
(
self
,
table
=
'stock'
,
**
kw
):
...
...
@@ -491,7 +491,7 @@ class SimulationTool(BaseTool):
simulation_query
=
ComplexQuery
(
simulation_query
,
reserved_query
,
operator
=
'OR'
,
logical_
operator
=
'OR'
,
)
if
simulation_query
is
not
None
:
new_kw
[
'query'
]
=
simulation_query
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getRelatedDocumentList.py
View file @
b6f4d46d
...
...
@@ -11,6 +11,6 @@ if follow_up_related_document_list:
kw['
query
'] = ComplexQuery(
kw['
query
'],
Query(uid=[x.getUid() for x in follow_up_related_document_list]),
operator='
or
')
logical_
operator='
or
')
return portal_catalog(portal_type=portal_type, limit=limit, **kw)
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_search.py
View file @
b6f4d46d
...
...
@@ -61,7 +61,7 @@ for key in sorted(request.form.keys()):
q_kw
=
{
key
:
None
}
left_join_list
.
append
(
key
)
left_join_list
.
append
(
'strict_%s'
%
key
)
query_list
.
append
(
ComplexQuery
(
NegatedQuery
(
Query
(
**
nq_kw
)),
Query
(
**
q_kw
),
operator
=
"OR"
))
query_list
.
append
(
ComplexQuery
(
NegatedQuery
(
Query
(
**
nq_kw
)),
Query
(
**
q_kw
),
logical_
operator
=
"OR"
))
new_mapping
[
key
]
=
""
new_mapping
[
"dialog_%s"
%
(
key
,)]
=
value
new_mapping
[
"dialog_excluded_%s"
%
(
key
,)]
=
True
...
...
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.py
View file @
b6f4d46d
...
...
@@ -6,5 +6,5 @@ from Products.ZSQLCatalog.SQLCatalog import Query
query
=
ComplexQuery
(
Query
(
title
=
value
),
Query
(
reference
=
value
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
return
query
product/ERP5Catalog/CatalogTool.py
View file @
b6f4d46d
...
...
@@ -619,8 +619,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
for
key
,
value
in
role_column_dict
.
items
():
new_query
=
Query
(
**
{
key
:
value
})
query_list
.
append
(
new_query
)
operator_kw
=
{
'operator'
:
'OR'
}
role_query
=
ComplexQuery
(
*
query_list
,
**
operator_kw
)
role_query
=
ComplexQuery
(
logical_operator
=
'OR'
,
*
query_list
)
if
security_uid_dict
:
catalog_security_uid_groups_columns_dict
=
\
self
.
getSQLCatalog
().
getSQLCatalogSecurityUidGroupsColumnsDict
()
...
...
@@ -634,12 +633,12 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
security_uid_list
,
'operator'
:
'IN'
}))
security_uid_query
=
ComplexQuery
(
*
query_list
,
operator
=
'OR'
)
security_uid_query
=
ComplexQuery
(
*
query_list
,
logical_
operator
=
'OR'
)
if
role_query
:
if
security_uid_query
:
# merge
query
=
ComplexQuery
(
security_uid_query
,
role_query
,
operator
=
'OR'
)
query
=
ComplexQuery
(
security_uid_query
,
role_query
,
logical_
operator
=
'OR'
)
else
:
query
=
role_query
elif
security_uid_query
:
...
...
@@ -659,9 +658,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
for
key
,
value
in
local_role_column_dict
.
items
():
new_query
=
Query
(
**
{
key
:
value
})
query_list
.
append
(
new_query
)
operator_kw
=
{
'operator'
:
'AND'
}
local_role_query
=
ComplexQuery
(
*
query_list
,
**
operator_kw
)
query
=
ComplexQuery
(
query
,
local_role_query
,
operator
=
'AND'
)
local_role_query
=
ComplexQuery
(
logical_operator
=
'AND'
,
*
query_list
)
query
=
ComplexQuery
(
query
,
local_role_query
,
logical_operator
=
'AND'
)
return
query
...
...
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
b6f4d46d
...
...
@@ -1213,7 +1213,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# title='bcd' OR description='efg'
catalog_kw
=
{
'query'
:
ComplexQuery
(
Query
(
title
=
'bcd'
),
Query
(
description
=
'efg'
),
operator
=
'OR'
)}
logical_
operator
=
'OR'
)}
self
.
failIfDifferentSet
([
org_b
.
getPath
(),
org_c
.
getPath
()],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
**
catalog_kw
)])
...
...
@@ -1222,11 +1222,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# title='foo' and description='bar'
catalog_kw
=
{
'query'
:
ComplexQuery
(
ComplexQuery
(
SimpleQuery
(
title
=
'abc'
),
SimpleQuery
(
description
=
'abc'
),
operator
=
'AND'
),
logical_
operator
=
'AND'
),
ComplexQuery
(
SimpleQuery
(
title
=
'foo'
),
SimpleQuery
(
description
=
'bar'
),
operator
=
'AND'
),
operator
=
'OR'
)}
logical_
operator
=
'AND'
),
logical_
operator
=
'OR'
)}
self
.
failIfDifferentSet
([
org_a
.
getPath
(),
org_f
.
getPath
()],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
**
catalog_kw
)])
...
...
@@ -1719,7 +1719,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# First try without aliases
query1
=
Query
(
parent_portal_type
=
"Organisation"
)
query2
=
Query
(
grand_parent_portal_type
=
"Organisation Module"
)
complex_query
=
ComplexQuery
(
query1
,
query2
,
operator
=
"AND"
)
complex_query
=
ComplexQuery
(
query1
,
query2
,
logical_
operator
=
"AND"
)
self
.
failIfDifferentSet
([
org_a
.
getPath
()
+
'/default_address'
],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
query
=
complex_query
)])
# Then try with aliases
...
...
@@ -1728,7 +1728,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
query2
=
Query
(
grand_parent_portal_type
=
"Organisation Module"
,
table_alias_list
=
((
"catalog"
,
"parent"
),
(
"catalog"
,
"grand_parent"
)))
complex_query
=
ComplexQuery
(
query1
,
query2
,
operator
=
"AND"
)
complex_query
=
ComplexQuery
(
query1
,
query2
,
logical_
operator
=
"AND"
)
self
.
failIfDifferentSet
([
org_a
.
getPath
()
+
'/default_address'
],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
query
=
complex_query
)])
sql_kw
=
self
.
getCatalogTool
().
buildSQLQuery
(
query
=
complex_query
)
...
...
@@ -2180,27 +2180,27 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# complex query
query
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
region_uid
=
asia
.
getUid
()),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query
)),
1
)
# complex query
query
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
region_uid
=
(
africa
.
getUid
(),
asia
.
getUid
())),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query
)),
2
)
# more complex query
query_find_european
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
region_uid
=
europe
.
getUid
()),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query_find_european
)),
1
)
query_find_name_erp5
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
title
=
'%ERP5'
),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query_find_name_erp5
)),
2
)
self
.
assertRaises
(
NotImplementedError
,
ComplexQuery
,
query_find_european
,
query_find_name_erp5
,
operator
=
'OR'
)
self
.
assertRaises
(
NotImplementedError
,
ComplexQuery
,
query_find_european
,
query_find_name_erp5
,
logical_
operator
=
'OR'
)
def
test_check_security_table_content
(
self
):
sql_connection
=
self
.
getSQLConnection
()
...
...
@@ -3525,19 +3525,19 @@ VALUES
'site_reference="foo" AND function_description="bar"'
,
ComplexQuery
(
Query
(
site_reference
=
'foo'
),
Query
(
function_description
=
'bar'
),
operator
=
'AND'
))
logical_
operator
=
'AND'
))
# Double join on same relation
check
(
both_object_list
,
'site_reference="foo" AND site_description="bar"'
,
ComplexQuery
(
Query
(
site_reference
=
'foo'
),
Query
(
site_description
=
'bar'
),
operator
=
'AND'
))
logical_
operator
=
'AND'
))
# Double join on same related key
check
(
title_object_list
,
'site_title="foo1" AND site_title="foo2"'
,
ComplexQuery
(
Query
(
site_title
=
'=foo1'
),
Query
(
site_title
=
'=foo2'
),
operator
=
'AND'
))
logical_
operator
=
'AND'
))
def
test_SearchFolderWithRelatedDynamicRelatedKey
(
self
):
# Create some objects
...
...
product/ERP5Type/patches/WorkflowTool.py
View file @
b6f4d46d
...
...
@@ -282,9 +282,9 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
**
{
my_criterion_id
:
criterion_value
})
if
isinstance
(
criterion_value
,
ExclusionTuple
):
query
=
NegatedQuery
(
query
)
query
=
ComplexQuery
(
operator
=
'OR'
,
query
=
ComplexQuery
(
logical_
operator
=
'OR'
,
*
(
query
,
getQuery
(
**
{
my_criterion_id
:
None
})))
append
(
ComplexQuery
(
query
,
subcriterion_query
,
operator
=
'AND'
))
append
(
ComplexQuery
(
query
,
subcriterion_query
,
logical_
operator
=
'AND'
))
else
:
possible_value_list
=
tuple
()
impossible_value_list
=
tuple
()
...
...
@@ -315,12 +315,12 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
**
{
my_criterion_id
:
impossible_value_list
}
)
query
=
NegatedQuery
(
query
)
query
=
ComplexQuery
(
operator
=
'OR'
,
query
=
ComplexQuery
(
logical_
operator
=
'OR'
,
*
(
query
,
getQuery
(
**
{
my_criterion_id
:
None
})))
value_query_list
.
append
(
query
)
append
(
ComplexQuery
(
operator
=
'AND'
,
*
value_query_list
))
append
(
ComplexQuery
(
logical_
operator
=
'AND'
,
*
value_query_list
))
if
len
(
query_list
):
return
ComplexQuery
(
operator
=
'OR'
,
*
query_list
)
return
ComplexQuery
(
logical_
operator
=
'OR'
,
*
query_list
)
return
None
def
getWorklistListQuery
(
getQuery
,
grouped_worklist_dict
):
...
...
product/ZSQLCatalog/SearchKey/DateTimeKey.py
View file @
b6f4d46d
...
...
@@ -162,7 +162,7 @@ def wholePeriod(search_key, group, column, value_list, exclude=False):
first_date
,
second_date
=
getPeriodBoundaries
(
value
)
append
(
ComplexQuery
([
SimpleQuery
(
search_key
=
search_key
,
comparison_operator
=
first_operator
,
group
=
group
,
**
{
column
:
first_date
}),
SimpleQuery
(
search_key
=
search_key
,
comparison_operator
=
second_operator
,
group
=
group
,
**
{
column
:
second_date
})],
operator
=
logical_operator
))
logical_
operator
=
logical_operator
))
return
query_list
def
matchWholePeriod
(
search_key
,
group
,
column
,
value_list
,
*
ignored
):
...
...
product/ZSQLCatalog/SearchKey/RelatedKey.py
View file @
b6f4d46d
...
...
@@ -231,7 +231,7 @@ class RelatedKey(SearchKey):
# Example:
# ComplexQuery(Query(title="foo"),
# Query(subordination_title="bar")
# , operator='OR')
# ,
logical_
operator='OR')
# Former catalog rendering (truncated where-expression):
# AND ((catalog.title LIKE '%foo%') OR
# (related_catalog_1.title LIKE '%bar%'))
...
...
product/ZSQLCatalog/SearchKey/SearchKey.py
View file @
b6f4d46d
...
...
@@ -362,7 +362,7 @@ class SearchKey(object):
if
len
(
query_list
)
==
1
:
query
=
query_list
[
0
]
else
:
query
=
ComplexQuery
(
query_list
,
operator
=
logical_operator
)
query
=
ComplexQuery
(
query_list
,
logical_
operator
=
logical_operator
)
return
query
def
parseSearchText
(
self
,
value
,
is_column
):
...
...
product/ZSQLCatalog/SearchText/SearchTextParser.py
View file @
b6f4d46d
This diff is collapsed.
Click to expand it.
product/ZSQLCatalog/tests/testSQLCatalog.py
View file @
b6f4d46d
...
...
@@ -825,7 +825,7 @@ class TestSQLCatalog(ERP5TypeTestCase):
#return catalog(title={'query': 'a', 'operator': 'not'})
#return catalog(title={'query': ['a', 'b'], 'operator': 'not'})
#return context.portal_catalog(source_title="toto", source_description="tutu", src__=1)
#print catalog(query=ComplexQuery(Query(title='1'), ComplexQuery(Query(portal_type='Foo') ,Query(portal_type='Bar'),
operator='or'),
operator='and'))
#print catalog(query=ComplexQuery(Query(title='1'), ComplexQuery(Query(portal_type='Foo') ,Query(portal_type='Bar'),
logical_operator='or'), logical_
operator='and'))
#print catalog(title={'query': ('path', 2), 'operator': 'and'}, exception=TypeError)
#print catalog(sort_on=[('source_title', )], check_search_text=False)
#print catalog(query=ComplexQuery(Query(source_title='foo'), Query(source_title='bar')), sort_on=[('source_title', ), ('source_title_1', )], check_search_text=False)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment