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
Richard
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
Hide 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):
...
@@ -101,7 +101,7 @@ if request.get('omit_grouping_reference', False):
params
[
'grouping_query'
]
=
ComplexQuery
(
params
[
'grouping_query'
]
=
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
else
:
params
[
'grouping_reference'
]
=
None
params
[
'grouping_reference'
]
=
None
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
View file @
b6f4d46d
...
@@ -17,7 +17,7 @@ inventory_query = {
...
@@ -17,7 +17,7 @@ inventory_query = {
'grouping_query'
:
ComplexQuery
(
'grouping_query'
:
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
operator
=
"OR"
),
logical_
operator
=
"OR"
),
'simulation_state'
:
params
[
'simulation_state'
],
'simulation_state'
:
params
[
'simulation_state'
],
'node_uid'
:
kw
[
'node_uid'
],
'node_uid'
:
kw
[
'node_uid'
],
'portal_type'
:
portal
.
getPortalAccountingMovementTypeList
(),
'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(
...
@@ -15,7 +15,7 @@ section_uid = portal.Base_getSectionUidListForSectionCategory(
grouping_query
=
ComplexQuery
(
grouping_query
=
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
Query
(
grouping_date
=
at_date
,
range
=
"min"
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
account_number_memo
=
{}
account_number_memo
=
{}
def
getAccountNumber
(
account_url
):
def
getAccountNumber
(
account_url
):
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.py
View file @
b6f4d46d
...
@@ -69,7 +69,7 @@ else:
...
@@ -69,7 +69,7 @@ else:
if
title
:
if
title
:
search_kw
[
'title_query'
]
=
ComplexQuery
(
Query
(
title
=
title
),
search_kw
[
'title_query'
]
=
ComplexQuery
(
Query
(
title
=
title
),
Query
(
parent_title
=
title
),
Query
(
parent_title
=
title
),
operator
=
'OR'
)
logical_
operator
=
'OR'
)
if
delivery_reference
:
if
delivery_reference
:
search_kw
[
'parent_reference'
]
=
delivery_reference
search_kw
[
'parent_reference'
]
=
delivery_reference
if
debit_price
:
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
...
@@ -93,7 +93,7 @@ if portal.portal_selections.getSelectionParamsFor(selection_name).get('omit_grou
params
[
'grouping_query'
]
=
ComplexQuery
(
params
[
'grouping_query'
]
=
ComplexQuery
(
Query
(
grouping_reference
=
None
),
Query
(
grouping_reference
=
None
),
Query
(
grouping_date
=
params
[
'at_date'
],
range
=
"min"
),
Query
(
grouping_date
=
params
[
'at_date'
],
range
=
"min"
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
else
:
params
[
'grouping_reference'
]
=
None
params
[
'grouping_reference'
]
=
None
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/FCKeditor_getDocumentListQuery.py
View file @
b6f4d46d
...
@@ -11,5 +11,5 @@ return ComplexQuery(
...
@@ -11,5 +11,5 @@ return ComplexQuery(
Query
(
validation_state
=
(
'published'
,
'published_alive'
,
'released'
,
'released_alive'
,
'shared'
,
'shared_alive'
),
Query
(
validation_state
=
(
'published'
,
'published_alive'
,
'released'
,
'released_alive'
,
'shared'
,
'shared_alive'
),
reference
=
'!=None'
),
reference
=
'!=None'
),
Query
(
validation_state
=
'embedded'
,
parent_uid
=
context
.
getUid
()),
Query
(
validation_state
=
'embedded'
,
parent_uid
=
context
.
getUid
()),
operator
=
'or'
),
logical_
operator
=
'or'
),
operator
=
'and'
)
logical_
operator
=
'and'
)
bt5/erp5_jio/SkinTemplateItem/portal_skins/erp5_jio/JIO_class.py
View file @
b6f4d46d
...
@@ -367,7 +367,7 @@ class JioGeneric():
...
@@ -367,7 +367,7 @@ class JioGeneric():
try
:
try
:
while
True
:
query_dict
[
'query_list'
].
remove
(
None
)
while
True
:
query_dict
[
'query_list'
].
remove
(
None
)
except
ValueError
:
pass
except
ValueError
:
pass
return
ComplexQuery
(
operator
=
query_dict
[
'operator'
],
return
ComplexQuery
(
logical_
operator
=
query_dict
[
'operator'
],
*
query_dict
[
'query_list'
])
*
query_dict
[
'query_list'
])
return
None
return
None
return
rec
(
query_dict
)
return
rec
(
query_dict
)
...
@@ -380,7 +380,7 @@ class JioGeneric():
...
@@ -380,7 +380,7 @@ class JioGeneric():
kw
[
'query'
]
=
ComplexQuery
(
kw
[
'query'
]
=
ComplexQuery
(
kw
[
'query'
],
kw
[
'query'
],
ComplexQuery
(
ComplexQuery
(
operator
=
'or'
,
logical_
operator
=
'or'
,
*
[
SimpleQuery
(
comparison_operator
=
"="
,
portal_type
=
x
)
\
*
[
SimpleQuery
(
comparison_operator
=
"="
,
portal_type
=
x
)
\
for
x
in
self
.
allowed_portal_type_list
]
for
x
in
self
.
allowed_portal_type_list
]
),
),
...
@@ -388,7 +388,7 @@ class JioGeneric():
...
@@ -388,7 +388,7 @@ class JioGeneric():
)
)
else
:
else
:
kw
[
'query'
]
=
ComplexQuery
(
kw
[
'query'
]
=
ComplexQuery
(
operator
=
'or'
,
logical_
operator
=
'or'
,
*
[
SimpleQuery
(
comparison_operator
=
"="
,
portal_type
=
x
)
\
*
[
SimpleQuery
(
comparison_operator
=
"="
,
portal_type
=
x
)
\
for
x
in
self
.
allowed_portal_type_list
]
for
x
in
self
.
allowed_portal_type_list
]
)
)
...
@@ -438,7 +438,7 @@ class JioGeneric():
...
@@ -438,7 +438,7 @@ class JioGeneric():
# editkw['query'] = ComplexQuery(
# editkw['query'] = ComplexQuery(
# editkw['query'],
# editkw['query'],
# ComplexQuery(
# ComplexQuery(
# operator='or',
#
logical_
operator='or',
# *[SimpleQuery(comparison_operator="=", portal_type=x) \
# *[SimpleQuery(comparison_operator="=", portal_type=x) \
# for x in self.allowed_portal_type_list]
# 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:
...
@@ -30,7 +30,7 @@ for action in ordered_global_action_list:
sub_query_list
=
[]
sub_query_list
=
[]
for
k
,
v
in
query_dict
.
items
():
for
k
,
v
in
query_dict
.
items
():
sub_query_list
.
append
(
Query
(
**
{
k
:
v
}))
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
# add to query filtering by local roles as defined in worklist
complex_query
=
portal
.
portal_catalog
.
getSecurityQuery
(
query
=
complex_query
,
local_roles
=
local_roles
)
complex_query
=
portal
.
portal_catalog
.
getSecurityQuery
(
query
=
complex_query
,
local_roles
=
local_roles
)
query_list
.
append
(
complex_query
)
query_list
.
append
(
complex_query
)
...
@@ -43,7 +43,7 @@ if not query_list:
...
@@ -43,7 +43,7 @@ if not query_list:
return
[]
return
[]
# Invoke catalog
# Invoke catalog
query
=
ComplexQuery
(
*
query_list
,
**
dict
(
operator
=
"OR"
)
)
query
=
ComplexQuery
(
logical_operator
=
"OR"
,
*
query_list
)
#query = portal.portal_catalog.getSecurityQuery(query)
#query = portal.portal_catalog.getSecurityQuery(query)
#result_list = portal.portal_catalog(query=query,
#result_list = portal.portal_catalog(query=query,
# sort_on='modification_date',
# 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():
...
@@ -18,7 +18,7 @@ for base_category_name, category in category_dict.items():
key
=
'ExactMatch'
),
key
=
'ExactMatch'
),
Query
(
reference
=
category
,
Query
(
reference
=
category
,
key
=
'ExactMatch'
),
key
=
'ExactMatch'
),
operator
=
'OR'
),
logical_
operator
=
'OR'
),
ComplexQuery
(
Query
(
relative_url
=
'%s/%%'
%
base_category_name
)))
ComplexQuery
(
Query
(
relative_url
=
'%s/%%'
%
base_category_name
)))
category_value
=
portal
.
portal_catalog
.
getResultValue
(
query
=
query
)
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
...
@@ -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
(
stop_date
=
"<=%s"
%
to_date
.
strftime
(
"%Y/%m/%d"
)),
Query
(
destination_trade_uid
=
Query
(
destination_trade_uid
=
destination_trade
.
getUid
())),
Query
(
destination_trade_uid
=
Query
(
destination_trade_uid
=
destination_trade
.
getUid
())),
Query
(
simulation_state
=
'!=cancelled'
),
Query
(
simulation_state
=
'!=cancelled'
),
operator
=
"AND"
)}
logical_
operator
=
"AND"
)}
paysheet_list
=
portal
.
accounting_module
.
searchFolder
(
portal_type
=
"Pay Sheet Transaction"
,
**
catalog_kw
)
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),
...
@@ -19,7 +19,7 @@ query = ComplexQuery(Query(parent_uid=event_uid_list),
Query
(
uid
=
event_uid_list
),
Query
(
uid
=
event_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
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
()
kw
[
'portal_type'
]
=
(
'PDF'
,
'Image'
)
+
context
.
getPortalDocumentTypeList
()
+
context
.
getPortalEventTypeList
()
return
context
.
portal_catalog
(
query
=
query
,
**
kw
)
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),
...
@@ -19,7 +19,7 @@ query = ComplexQuery(Query(parent_uid=event_uid_list),
Query
(
uid
=
event_uid_list
),
Query
(
uid
=
event_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
uid
=
attachment_pdf_uid_list
),
Query
(
uid
=
attachment_pdf_uid_list
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
kw
[
'portal_type'
]
=
(
'PDF'
)
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),
...
@@ -30,7 +30,7 @@ query = ComplexQuery(Query(parent_uid=event_uid_list),
Query
(
uid
=
event_uid_list
),
Query
(
uid
=
event_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
parent_uid
=
attachment_pdf_uid_list
),
Query
(
uid
=
attachment_pdf_uid_list
),
Query
(
uid
=
attachment_pdf_uid_list
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
kw
[
'portal_type'
]
=
(
'PDF'
)
kw
[
'portal_type'
]
=
(
'PDF'
)
result_uid
=
[
x
.
getUid
()
for
x
in
context
.
portal_catalog
(
query
=
query
,
**
kw
)]
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:
...
@@ -48,7 +48,7 @@ for item in items:
# query = ComplexQuery(Query(title=person_title),
# query = ComplexQuery(Query(title=person_title),
# Query(birth_date=item['start_date']),
# Query(birth_date=item['start_date']),
# Query(birthplace_city=item['default_birthplace_address_city']),
# Query(birthplace_city=item['default_birthplace_address_city']),
# operator="AND")
#
logical_
operator="AND")
# best_candidate_list=list(context.portal_catalog(portal_type='Person',
# best_candidate_list=list(context.portal_catalog(portal_type='Person',
# query=query))
# query=query))
#verify that the new person is not selected more than once in the fast input
#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:
...
@@ -46,7 +46,7 @@ for item in items:
# query = ComplexQuery(Query(title=person_title),
# query = ComplexQuery(Query(title=person_title),
# Query(birth_date=item['start_date']),
# Query(birth_date=item['start_date']),
# Query(birthplace_city=item['default_birthplace_address_city']),
# Query(birthplace_city=item['default_birthplace_address_city']),
# operator="AND")
#
logical_
operator="AND")
# best_candidate_list=list(context.portal_catalog(portal_type='Person',
# best_candidate_list=list(context.portal_catalog(portal_type='Person',
# query=query))
# query=query))
#verify that the new person is not selected more than once in the fast input
#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:
...
@@ -54,31 +54,31 @@ if person_start_date == None or person_birthplace == None:
Query
(
title
=
person_title_reversed
),
Query
(
title
=
person_title_reversed
),
Query
(
title
=
person_first_name
),
Query
(
title
=
person_first_name
),
Query
(
title
=
person_last_name
),
Query
(
title
=
person_last_name
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
else
:
query
=
ComplexQuery
(
Query
(
title
=
person_title
),
query
=
ComplexQuery
(
Query
(
title
=
person_title
),
ComplexQuery
(
ComplexQuery
(
Query
(
title
=
person_title
),
Query
(
title
=
person_title
),
Query
(
birth_date
=
person_start_date
),
Query
(
birth_date
=
person_start_date
),
operator
=
"AND"
),
logical_
operator
=
"AND"
),
ComplexQuery
(
ComplexQuery
(
Query
(
title
=
person_title
),
Query
(
title
=
person_title
),
Query
(
birthplace_city
=
person_birthplace
),
Query
(
birthplace_city
=
person_birthplace
),
operator
=
"AND"
),
logical_
operator
=
"AND"
),
ComplexQuery
(
ComplexQuery
(
Query
(
birth_date
=
person_start_date
),
Query
(
birth_date
=
person_start_date
),
Query
(
birthplace_city
=
person_birthplace
),
Query
(
birthplace_city
=
person_birthplace
),
operator
=
"AND"
),
logical_
operator
=
"AND"
),
ComplexQuery
(
ComplexQuery
(
Query
(
title
=
person_title_reversed
),
Query
(
title
=
person_title_reversed
),
Query
(
title
=
person_first_name
),
Query
(
title
=
person_first_name
),
Query
(
title
=
person_last_name
),
Query
(
title
=
person_last_name
),
operator
=
"OR"
),
logical_
operator
=
"OR"
),
ComplexQuery
(
ComplexQuery
(
Query
(
title
=
person_title
),
Query
(
title
=
person_title
),
Query
(
birth_date
=
[
DateTime
(
person_start_date
.
year
(),
1
,
1
),
DateTime
(
person_start_date
.
year
(),
12
,
31
),],
range
=
'minmax'
),
Query
(
birth_date
=
[
DateTime
(
person_start_date
.
year
(),
1
,
1
),
DateTime
(
person_start_date
.
year
(),
12
,
31
),],
range
=
'minmax'
),
operator
=
"AND"
),
logical_
operator
=
"AND"
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
select_expression
=
\
select_expression
=
\
"""((title ="%s"))AS result_order
"""((title ="%s"))AS result_order
"""
%
(
person_title
)
"""
%
(
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(
...
@@ -79,7 +79,7 @@ new_registry_number = request_eform.portal_ids.generateNewId(
query
=
ComplexQuery
(
Query
(
title
=
request_eform
.
getTitle
()),
query
=
ComplexQuery
(
Query
(
title
=
request_eform
.
getTitle
()),
Query
(
birth_date
=
request_eform
.
getStartDate
()),
Query
(
birth_date
=
request_eform
.
getStartDate
()),
Query
(
birthplace_city
=
request_eform
.
getDefaultBirthplaceAddressCity
()),
Query
(
birthplace_city
=
request_eform
.
getDefaultBirthplaceAddressCity
()),
operator
=
"AND"
)
logical_
operator
=
"AND"
)
person_list
=
[
person
.
getObject
()
for
person
in
person_module
.
searchFolder
(
query
=
query
)]
person_list
=
[
person
.
getObject
()
for
person
in
person_module
.
searchFolder
(
query
=
query
)]
if
request_eform
.
getBeginning
()
or
request_eform
.
getOpening
():
if
request_eform
.
getBeginning
()
or
request_eform
.
getOpening
():
if
len
(
person_list
)
==
0
:
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
...
@@ -49,7 +49,7 @@ request_eform.setTitle(request_eform.getOwnerFirstName()+' '+request_eform.getOw
query
=
ComplexQuery
(
Query
(
title
=
request_eform
.
getTitle
()),
query
=
ComplexQuery
(
Query
(
title
=
request_eform
.
getTitle
()),
Query
(
birth_date
=
request_eform
.
getOwnerBirthday
()),
Query
(
birth_date
=
request_eform
.
getOwnerBirthday
()),
Query
(
birthplace_city
=
request_eform
.
getOwnerBirthplace
()),
Query
(
birthplace_city
=
request_eform
.
getOwnerBirthplace
()),
operator
=
"AND"
)
logical_
operator
=
"AND"
)
person_list
=
[
person
.
getObject
()
for
person
in
\
person_list
=
[
person
.
getObject
()
for
person
in
\
context
.
portal_catalog
(
portal_type
=
'Person'
,
query
=
query
)]
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 = []
...
@@ -16,11 +16,11 @@ new_test_result_list = []
context
.
log
(
"rev_query_list"
,
rev_query_list
)
context
.
log
(
"rev_query_list"
,
rev_query_list
)
if
rev_query_list
:
if
rev_query_list
:
result
=
context
.
searchFolder
(
title
=
'PERF-ERP5-MASTER'
,
simulation_state
=
'stopped'
,
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
)
sort_on
=
((
'delivery.start_date'
,
'ASC'
),),
src__
=
1
)
context
.
log
(
"result"
,
result
)
context
.
log
(
"result"
,
result
)
for
test
in
context
.
searchFolder
(
title
=
'PERF-ERP5-MASTER'
,
simulation_state
=
'stopped'
,
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'
),)):
sort_on
=
((
'delivery.start_date'
,
'ASC'
),)):
test
=
test
.
getObject
()
test
=
test
.
getObject
()
if
revision
!=
test
.
getReference
():
if
revision
!=
test
.
getReference
():
...
...
product/ERP5/Document/NodeBudgetVariation.py
View file @
b6f4d46d
...
@@ -204,7 +204,7 @@ class NodeBudgetVariation(BudgetVariation):
...
@@ -204,7 +204,7 @@ class NodeBudgetVariation(BudgetVariation):
query
=
ComplexQuery
(
query
=
ComplexQuery
(
NegatedQuery
(
Query
(
**
{
axis
:
other_uid_list
})),
NegatedQuery
(
Query
(
**
{
axis
:
other_uid_list
})),
Query
(
**
{
axis
:
None
}),
Query
(
**
{
axis
:
None
}),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
else
:
value
=
portal_categories
.
getCategoryValue
(
node_url
,
value
=
portal_categories
.
getCategoryValue
(
node_url
,
...
@@ -219,7 +219,7 @@ class NodeBudgetVariation(BudgetVariation):
...
@@ -219,7 +219,7 @@ class NodeBudgetVariation(BudgetVariation):
query_dict
[
axis
]
=
ComplexQuery
(
query_dict
[
axis
]
=
ComplexQuery
(
query
,
query
,
Query
(
**
{
axis
:
query_dict
[
axis
]}),
Query
(
**
{
axis
:
query_dict
[
axis
]}),
operator
=
'OR'
)
logical_
operator
=
'OR'
)
else
:
else
:
query_dict
[
axis
]
=
query
query_dict
[
axis
]
=
query
...
@@ -297,7 +297,7 @@ class NodeBudgetVariation(BudgetVariation):
...
@@ -297,7 +297,7 @@ class NodeBudgetVariation(BudgetVariation):
query_dict
[
axis
]
=
ComplexQuery
(
query_dict
[
axis
]
=
ComplexQuery
(
Query
(
**
{
axis
:
None
}),
Query
(
**
{
axis
:
None
}),
Query
(
**
{
axis
:
query_dict
[
axis
]}),
Query
(
**
{
axis
:
query_dict
[
axis
]}),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
else
:
else
:
query_dict
[
axis
]
=
Query
(
**
{
axis
:
None
})
query_dict
[
axis
]
=
Query
(
**
{
axis
:
None
})
return
query_dict
return
query_dict
...
...
product/ERP5/Tool/SimulationTool.py
View file @
b6f4d46d
...
@@ -246,7 +246,7 @@ class SimulationTool(BaseTool):
...
@@ -246,7 +246,7 @@ class SimulationTool(BaseTool):
simulation_query
=
ComplexQuery
(
simulation_query
=
ComplexQuery
(
self
.
_getIncreaseQuery
(
table
,
'quantity'
,
True
),
self
.
_getIncreaseQuery
(
table
,
'quantity'
,
True
),
SimpleQuery
(
**
{
table
+
'.simulation_state'
:
input_simulation_state
}),
SimpleQuery
(
**
{
table
+
'.simulation_state'
:
input_simulation_state
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
)
)
output_simulation_state
=
simulation_state_dict
.
get
(
'output_simulation_state'
)
output_simulation_state
=
simulation_state_dict
.
get
(
'output_simulation_state'
)
if
output_simulation_state
is
not
None
:
if
output_simulation_state
is
not
None
:
...
@@ -255,9 +255,9 @@ class SimulationTool(BaseTool):
...
@@ -255,9 +255,9 @@ class SimulationTool(BaseTool):
ComplexQuery
(
ComplexQuery
(
self
.
_getIncreaseQuery
(
table
,
'quantity'
,
False
),
self
.
_getIncreaseQuery
(
table
,
'quantity'
,
False
),
SimpleQuery
(
**
{
table
+
'.simulation_state'
:
output_simulation_state
}),
SimpleQuery
(
**
{
table
+
'.simulation_state'
:
output_simulation_state
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
),
),
operator
=
'OR'
logical_
operator
=
'OR'
)
)
return
simulation_query
return
simulation_query
...
@@ -378,14 +378,14 @@ class SimulationTool(BaseTool):
...
@@ -378,14 +378,14 @@ class SimulationTool(BaseTool):
ComplexQuery
(
ComplexQuery
(
SimpleQuery
(
comparison_operator
=
'<'
,
**
{
table
+
'.'
+
column
:
0
}),
SimpleQuery
(
comparison_operator
=
'<'
,
**
{
table
+
'.'
+
column
:
0
}),
SimpleQuery
(
**
{
table
+
'.is_cancellation'
:
increase
}),
SimpleQuery
(
**
{
table
+
'.is_cancellation'
:
increase
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
),
),
ComplexQuery
(
ComplexQuery
(
SimpleQuery
(
comparison_operator
=
'>='
,
**
{
table
+
'.'
+
column
:
0
}),
SimpleQuery
(
comparison_operator
=
'>='
,
**
{
table
+
'.'
+
column
:
0
}),
SimpleQuery
(
**
{
table
+
'.is_cancellation'
:
not
increase
}),
SimpleQuery
(
**
{
table
+
'.is_cancellation'
:
not
increase
}),
operator
=
'AND'
,
logical_
operator
=
'AND'
,
),
),
operator
=
'OR'
,
logical_
operator
=
'OR'
,
)
)
def
_generateSQLKeywordDict
(
self
,
table
=
'stock'
,
**
kw
):
def
_generateSQLKeywordDict
(
self
,
table
=
'stock'
,
**
kw
):
...
@@ -491,7 +491,7 @@ class SimulationTool(BaseTool):
...
@@ -491,7 +491,7 @@ class SimulationTool(BaseTool):
simulation_query
=
ComplexQuery
(
simulation_query
=
ComplexQuery
(
simulation_query
,
simulation_query
,
reserved_query
,
reserved_query
,
operator
=
'OR'
,
logical_
operator
=
'OR'
,
)
)
if
simulation_query
is
not
None
:
if
simulation_query
is
not
None
:
new_kw
[
'query'
]
=
simulation_query
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:
...
@@ -11,6 +11,6 @@ if follow_up_related_document_list:
kw['
query
'] = ComplexQuery(
kw['
query
'] = ComplexQuery(
kw['
query
'],
kw['
query
'],
Query(uid=[x.getUid() for x in follow_up_related_document_list]),
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)
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()):
...
@@ -61,7 +61,7 @@ for key in sorted(request.form.keys()):
q_kw
=
{
key
:
None
}
q_kw
=
{
key
:
None
}
left_join_list
.
append
(
key
)
left_join_list
.
append
(
key
)
left_join_list
.
append
(
'strict_%s'
%
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
[
key
]
=
""
new_mapping
[
"dialog_%s"
%
(
key
,)]
=
value
new_mapping
[
"dialog_%s"
%
(
key
,)]
=
value
new_mapping
[
"dialog_excluded_%s"
%
(
key
,)]
=
True
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
...
@@ -6,5 +6,5 @@ from Products.ZSQLCatalog.SQLCatalog import Query
query
=
ComplexQuery
(
Query
(
title
=
value
),
query
=
ComplexQuery
(
Query
(
title
=
value
),
Query
(
reference
=
value
),
Query
(
reference
=
value
),
operator
=
"OR"
)
logical_
operator
=
"OR"
)
return
query
return
query
product/ERP5Catalog/CatalogTool.py
View file @
b6f4d46d
...
@@ -619,8 +619,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -619,8 +619,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
for
key
,
value
in
role_column_dict
.
items
():
for
key
,
value
in
role_column_dict
.
items
():
new_query
=
Query
(
**
{
key
:
value
})
new_query
=
Query
(
**
{
key
:
value
})
query_list
.
append
(
new_query
)
query_list
.
append
(
new_query
)
operator_kw
=
{
'operator'
:
'OR'
}
role_query
=
ComplexQuery
(
logical_operator
=
'OR'
,
*
query_list
)
role_query
=
ComplexQuery
(
*
query_list
,
**
operator_kw
)
if
security_uid_dict
:
if
security_uid_dict
:
catalog_security_uid_groups_columns_dict
=
\
catalog_security_uid_groups_columns_dict
=
\
self
.
getSQLCatalog
().
getSQLCatalogSecurityUidGroupsColumnsDict
()
self
.
getSQLCatalog
().
getSQLCatalogSecurityUidGroupsColumnsDict
()
...
@@ -634,12 +633,12 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -634,12 +633,12 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
security_uid_list
,
security_uid_list
,
'operator'
:
'IN'
}))
'operator'
:
'IN'
}))
security_uid_query
=
ComplexQuery
(
*
query_list
,
operator
=
'OR'
)
security_uid_query
=
ComplexQuery
(
*
query_list
,
logical_
operator
=
'OR'
)
if
role_query
:
if
role_query
:
if
security_uid_query
:
if
security_uid_query
:
# merge
# merge
query
=
ComplexQuery
(
security_uid_query
,
role_query
,
operator
=
'OR'
)
query
=
ComplexQuery
(
security_uid_query
,
role_query
,
logical_
operator
=
'OR'
)
else
:
else
:
query
=
role_query
query
=
role_query
elif
security_uid_query
:
elif
security_uid_query
:
...
@@ -659,9 +658,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -659,9 +658,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
for
key
,
value
in
local_role_column_dict
.
items
():
for
key
,
value
in
local_role_column_dict
.
items
():
new_query
=
Query
(
**
{
key
:
value
})
new_query
=
Query
(
**
{
key
:
value
})
query_list
.
append
(
new_query
)
query_list
.
append
(
new_query
)
operator_kw
=
{
'operator'
:
'AND'
}
local_role_query
=
ComplexQuery
(
logical_operator
=
'AND'
,
*
query_list
)
local_role_query
=
ComplexQuery
(
*
query_list
,
**
operator_kw
)
query
=
ComplexQuery
(
query
,
local_role_query
,
logical_operator
=
'AND'
)
query
=
ComplexQuery
(
query
,
local_role_query
,
operator
=
'AND'
)
return
query
return
query
...
...
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
b6f4d46d
...
@@ -1213,7 +1213,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1213,7 +1213,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# title='bcd' OR description='efg'
# title='bcd' OR description='efg'
catalog_kw
=
{
'query'
:
ComplexQuery
(
Query
(
title
=
'bcd'
),
catalog_kw
=
{
'query'
:
ComplexQuery
(
Query
(
title
=
'bcd'
),
Query
(
description
=
'efg'
),
Query
(
description
=
'efg'
),
operator
=
'OR'
)}
logical_
operator
=
'OR'
)}
self
.
failIfDifferentSet
([
org_b
.
getPath
(),
org_c
.
getPath
()],
self
.
failIfDifferentSet
([
org_b
.
getPath
(),
org_c
.
getPath
()],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
**
catalog_kw
)])
portal_type
=
'Organisation'
,
**
catalog_kw
)])
...
@@ -1222,11 +1222,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1222,11 +1222,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# title='foo' and description='bar'
# title='foo' and description='bar'
catalog_kw
=
{
'query'
:
ComplexQuery
(
ComplexQuery
(
SimpleQuery
(
title
=
'abc'
),
catalog_kw
=
{
'query'
:
ComplexQuery
(
ComplexQuery
(
SimpleQuery
(
title
=
'abc'
),
SimpleQuery
(
description
=
'abc'
),
SimpleQuery
(
description
=
'abc'
),
operator
=
'AND'
),
logical_
operator
=
'AND'
),
ComplexQuery
(
SimpleQuery
(
title
=
'foo'
),
ComplexQuery
(
SimpleQuery
(
title
=
'foo'
),
SimpleQuery
(
description
=
'bar'
),
SimpleQuery
(
description
=
'bar'
),
operator
=
'AND'
),
logical_
operator
=
'AND'
),
operator
=
'OR'
)}
logical_
operator
=
'OR'
)}
self
.
failIfDifferentSet
([
org_a
.
getPath
(),
org_f
.
getPath
()],
self
.
failIfDifferentSet
([
org_a
.
getPath
(),
org_f
.
getPath
()],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
**
catalog_kw
)])
portal_type
=
'Organisation'
,
**
catalog_kw
)])
...
@@ -1719,7 +1719,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1719,7 +1719,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# First try without aliases
# First try without aliases
query1
=
Query
(
parent_portal_type
=
"Organisation"
)
query1
=
Query
(
parent_portal_type
=
"Organisation"
)
query2
=
Query
(
grand_parent_portal_type
=
"Organisation Module"
)
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'
],
self
.
failIfDifferentSet
([
org_a
.
getPath
()
+
'/default_address'
],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
query
=
complex_query
)])
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
query
=
complex_query
)])
# Then try with aliases
# Then try with aliases
...
@@ -1728,7 +1728,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1728,7 +1728,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
query2
=
Query
(
grand_parent_portal_type
=
"Organisation Module"
,
query2
=
Query
(
grand_parent_portal_type
=
"Organisation Module"
,
table_alias_list
=
((
"catalog"
,
"parent"
),
table_alias_list
=
((
"catalog"
,
"parent"
),
(
"catalog"
,
"grand_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'
],
self
.
failIfDifferentSet
([
org_a
.
getPath
()
+
'/default_address'
],
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
query
=
complex_query
)])
[
x
.
path
for
x
in
self
.
getCatalogTool
()(
query
=
complex_query
)])
sql_kw
=
self
.
getCatalogTool
().
buildSQLQuery
(
query
=
complex_query
)
sql_kw
=
self
.
getCatalogTool
().
buildSQLQuery
(
query
=
complex_query
)
...
@@ -2180,27 +2180,27 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -2180,27 +2180,27 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# complex query
# complex query
query
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
query
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
region_uid
=
asia
.
getUid
()),
Query
(
region_uid
=
asia
.
getUid
()),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query
)),
1
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query
)),
1
)
# complex query
# complex query
query
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
query
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
region_uid
=
(
africa
.
getUid
(),
asia
.
getUid
())),
Query
(
region_uid
=
(
africa
.
getUid
(),
asia
.
getUid
())),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query
)),
2
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query
)),
2
)
# more complex query
# more complex query
query_find_european
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
query_find_european
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
region_uid
=
europe
.
getUid
()),
Query
(
region_uid
=
europe
.
getUid
()),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query_find_european
)),
1
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query_find_european
)),
1
)
query_find_name_erp5
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
query_find_name_erp5
=
ComplexQuery
(
Query
(
portal_type
=
'Person'
),
Query
(
title
=
'%ERP5'
),
Query
(
title
=
'%ERP5'
),
operator
=
'AND'
)
logical_
operator
=
'AND'
)
self
.
assertEqual
(
len
(
catalog
(
query
=
query_find_name_erp5
)),
2
)
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
):
def
test_check_security_table_content
(
self
):
sql_connection
=
self
.
getSQLConnection
()
sql_connection
=
self
.
getSQLConnection
()
...
@@ -3525,19 +3525,19 @@ VALUES
...
@@ -3525,19 +3525,19 @@ VALUES
'site_reference="foo" AND function_description="bar"'
,
'site_reference="foo" AND function_description="bar"'
,
ComplexQuery
(
Query
(
site_reference
=
'foo'
),
ComplexQuery
(
Query
(
site_reference
=
'foo'
),
Query
(
function_description
=
'bar'
),
Query
(
function_description
=
'bar'
),
operator
=
'AND'
))
logical_
operator
=
'AND'
))
# Double join on same relation
# Double join on same relation
check
(
both_object_list
,
check
(
both_object_list
,
'site_reference="foo" AND site_description="bar"'
,
'site_reference="foo" AND site_description="bar"'
,
ComplexQuery
(
Query
(
site_reference
=
'foo'
),
ComplexQuery
(
Query
(
site_reference
=
'foo'
),
Query
(
site_description
=
'bar'
),
Query
(
site_description
=
'bar'
),
operator
=
'AND'
))
logical_
operator
=
'AND'
))
# Double join on same related key
# Double join on same related key
check
(
title_object_list
,
check
(
title_object_list
,
'site_title="foo1" AND site_title="foo2"'
,
'site_title="foo1" AND site_title="foo2"'
,
ComplexQuery
(
Query
(
site_title
=
'=foo1'
),
ComplexQuery
(
Query
(
site_title
=
'=foo1'
),
Query
(
site_title
=
'=foo2'
),
Query
(
site_title
=
'=foo2'
),
operator
=
'AND'
))
logical_
operator
=
'AND'
))
def
test_SearchFolderWithRelatedDynamicRelatedKey
(
self
):
def
test_SearchFolderWithRelatedDynamicRelatedKey
(
self
):
# Create some objects
# Create some objects
...
...
product/ERP5Type/patches/WorkflowTool.py
View file @
b6f4d46d
...
@@ -282,9 +282,9 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
...
@@ -282,9 +282,9 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
**
{
my_criterion_id
:
criterion_value
})
**
{
my_criterion_id
:
criterion_value
})
if
isinstance
(
criterion_value
,
ExclusionTuple
):
if
isinstance
(
criterion_value
,
ExclusionTuple
):
query
=
NegatedQuery
(
query
)
query
=
NegatedQuery
(
query
)
query
=
ComplexQuery
(
operator
=
'OR'
,
query
=
ComplexQuery
(
logical_
operator
=
'OR'
,
*
(
query
,
getQuery
(
**
{
my_criterion_id
:
None
})))
*
(
query
,
getQuery
(
**
{
my_criterion_id
:
None
})))
append
(
ComplexQuery
(
query
,
subcriterion_query
,
operator
=
'AND'
))
append
(
ComplexQuery
(
query
,
subcriterion_query
,
logical_
operator
=
'AND'
))
else
:
else
:
possible_value_list
=
tuple
()
possible_value_list
=
tuple
()
impossible_value_list
=
tuple
()
impossible_value_list
=
tuple
()
...
@@ -315,12 +315,12 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
...
@@ -315,12 +315,12 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
**
{
my_criterion_id
:
impossible_value_list
}
**
{
my_criterion_id
:
impossible_value_list
}
)
)
query
=
NegatedQuery
(
query
)
query
=
NegatedQuery
(
query
)
query
=
ComplexQuery
(
operator
=
'OR'
,
query
=
ComplexQuery
(
logical_
operator
=
'OR'
,
*
(
query
,
getQuery
(
**
{
my_criterion_id
:
None
})))
*
(
query
,
getQuery
(
**
{
my_criterion_id
:
None
})))
value_query_list
.
append
(
query
)
value_query_list
.
append
(
query
)
append
(
ComplexQuery
(
operator
=
'AND'
,
*
value_query_list
))
append
(
ComplexQuery
(
logical_
operator
=
'AND'
,
*
value_query_list
))
if
len
(
query_list
):
if
len
(
query_list
):
return
ComplexQuery
(
operator
=
'OR'
,
*
query_list
)
return
ComplexQuery
(
logical_
operator
=
'OR'
,
*
query_list
)
return
None
return
None
def
getWorklistListQuery
(
getQuery
,
grouped_worklist_dict
):
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):
...
@@ -162,7 +162,7 @@ def wholePeriod(search_key, group, column, value_list, exclude=False):
first_date
,
second_date
=
getPeriodBoundaries
(
value
)
first_date
,
second_date
=
getPeriodBoundaries
(
value
)
append
(
ComplexQuery
([
SimpleQuery
(
search_key
=
search_key
,
comparison_operator
=
first_operator
,
group
=
group
,
**
{
column
:
first_date
}),
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
})],
SimpleQuery
(
search_key
=
search_key
,
comparison_operator
=
second_operator
,
group
=
group
,
**
{
column
:
second_date
})],
operator
=
logical_operator
))
logical_
operator
=
logical_operator
))
return
query_list
return
query_list
def
matchWholePeriod
(
search_key
,
group
,
column
,
value_list
,
*
ignored
):
def
matchWholePeriod
(
search_key
,
group
,
column
,
value_list
,
*
ignored
):
...
...
product/ZSQLCatalog/SearchKey/RelatedKey.py
View file @
b6f4d46d
...
@@ -231,7 +231,7 @@ class RelatedKey(SearchKey):
...
@@ -231,7 +231,7 @@ class RelatedKey(SearchKey):
# Example:
# Example:
# ComplexQuery(Query(title="foo"),
# ComplexQuery(Query(title="foo"),
# Query(subordination_title="bar")
# Query(subordination_title="bar")
# , operator='OR')
# ,
logical_
operator='OR')
# Former catalog rendering (truncated where-expression):
# Former catalog rendering (truncated where-expression):
# AND ((catalog.title LIKE '%foo%') OR
# AND ((catalog.title LIKE '%foo%') OR
# (related_catalog_1.title LIKE '%bar%'))
# (related_catalog_1.title LIKE '%bar%'))
...
...
product/ZSQLCatalog/SearchKey/SearchKey.py
View file @
b6f4d46d
...
@@ -362,7 +362,7 @@ class SearchKey(object):
...
@@ -362,7 +362,7 @@ class SearchKey(object):
if
len
(
query_list
)
==
1
:
if
len
(
query_list
)
==
1
:
query
=
query_list
[
0
]
query
=
query_list
[
0
]
else
:
else
:
query
=
ComplexQuery
(
query_list
,
operator
=
logical_operator
)
query
=
ComplexQuery
(
query_list
,
logical_
operator
=
logical_operator
)
return
query
return
query
def
parseSearchText
(
self
,
value
,
is_column
):
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):
...
@@ -825,7 +825,7 @@ class TestSQLCatalog(ERP5TypeTestCase):
#return catalog(title={'query': 'a', 'operator': 'not'})
#return catalog(title={'query': 'a', 'operator': 'not'})
#return catalog(title={'query': ['a', 'b'], 'operator': 'not'})
#return catalog(title={'query': ['a', 'b'], 'operator': 'not'})
#return context.portal_catalog(source_title="toto", source_description="tutu", src__=1)
#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(title={'query': ('path', 2), 'operator': 'and'}, exception=TypeError)
#print catalog(sort_on=[('source_title', )], check_search_text=False)
#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)
#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