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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
erp5
Commits
c208c12d
Commit
c208c12d
authored
Mar 07, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: Stop using *_expression catalog arguments.
These are the easy uses, there are more to come.
parent
aaa0e481
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
35 additions
and
21 deletions
+35
-21
bt5/erp5_email_reader/SkinTemplateItem/portal_skins/erp5_email_reader/EmailReader_generateTopicDomain.py
...kins/erp5_email_reader/EmailReader_generateTopicDomain.py
+2
-2
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskModule_generatePersonDomain.py
...tal_skins/erp5_project/TaskModule_generatePersonDomain.py
+1
-1
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskModule_generateProjectDomain.py
...al_skins/erp5_project/TaskModule_generateProjectDomain.py
+2
-2
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskReportModule_generatePersonDomain.py
...ins/erp5_project/TaskReportModule_generatePersonDomain.py
+1
-1
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskReportModule_generateProjectDomain.py
...ns/erp5_project/TaskReportModule_generateProjectDomain.py
+2
-2
bt5/erp5_tiosafe_oscommerce/ExtensionTemplateItem/OscommerceERP5NodeConduit.py
...mmerce/ExtensionTemplateItem/OscommerceERP5NodeConduit.py
+8
-2
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_viewSubjectIndexRenderer.py
...web_widget_library/WebSection_viewSubjectIndexRenderer.py
+1
-1
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+1
-1
product/ERP5/tests/testSupply.py
product/ERP5/tests/testSupply.py
+1
-1
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+2
-2
product/ERP5Catalog/tests/testERP5Catalog.py
product/ERP5Catalog/tests/testERP5Catalog.py
+5
-3
product/ERP5TioSafe/Conduit/ERP5NodeConduit.py
product/ERP5TioSafe/Conduit/ERP5NodeConduit.py
+8
-2
product/ERP5eGovSecurity/EGOVUserManager.py
product/ERP5eGovSecurity/EGOVUserManager.py
+1
-1
No files found.
bt5/erp5_email_reader/SkinTemplateItem/portal_skins/erp5_email_reader/EmailReader_generateTopicDomain.py
View file @
c208c12d
...
...
@@ -20,8 +20,8 @@ def getAvailableSubjectList(subject_list=(), container_uid=None):
"""
#log("In getAvailableSubjectList with container: %s subject_list: %s" % (container_uid, subject_list))
kw
=
dict
(
subject
=
"!="
,
select_
expression
=
"subject.subject"
,
group_by
_expression
=
"subject.subject"
,
select_
list
=
[
"subject.subject"
],
group_by
=
[
"subject.subject"
]
,
#src__=1
)
if
container_uid
:
kw
[
'parent_uid'
]
=
container_uid
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskModule_generatePersonDomain.py
View file @
c208c12d
...
...
@@ -4,7 +4,7 @@ if depth == 0:
task_uid_list
=
context
.
portal_selections
.
getSelectionUidList
(
context
=
context
,
selection_name
=
'task_module_selection'
)
person_result
=
context
.
portal_catalog
(
portal_type
=
[
"Person"
,],
source_related_uid
=
task_uid_list
,
select_
expression
=
'relative_url, id, title'
,
select_
list
=
[
'relative_url'
,
'id'
,
'title'
]
,
sort_on
=
((
'title'
,
'ascending'
),))
person_dict
=
{}
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskModule_generateProjectDomain.py
View file @
c208c12d
...
...
@@ -6,11 +6,11 @@ def Task_getRelatedSourceProject(depth, parent_relative_url=None):
task_uid_list
=
context
.
portal_selections
.
getSelectionUidList
(
context
=
context
,
selection_name
=
'task_module_selection'
)
project_result
=
context
.
portal_catalog
(
portal_type
=
[
"Project"
,
"Project Line"
],
source_project_related_uid
=
task_uid_list
,
select_
expression
=
'portal_type, relative_url, id, title'
,
select_
list
=
[
'portal_type'
,
'relative_url'
,
'id'
,
'title'
]
,
sort_on
=
((
'title'
,
'ascending'
),))
else
:
project_result
=
context
.
portal_catalog
(
portal_type
=
[
"Project Line"
,
"Project Milestones"
],
select_
expression
=
'portal_type, relative_url, id, title'
,
select_
list
=
[
'portal_type'
,
'relative_url'
,
'id'
,
'title'
]
,
parent_relative_url
=
parent_relative_url
,
sort_on
=
((
'title'
,
'ascending'
),))
# use a dict to store catalog result
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskReportModule_generatePersonDomain.py
View file @
c208c12d
...
...
@@ -4,7 +4,7 @@ if depth == 0:
task_uid_list
=
context
.
portal_selections
.
getSelectionUidList
(
context
=
context
,
selection_name
=
'task_report_module_selection'
)
person_result
=
context
.
portal_catalog
(
portal_type
=
[
"Person"
,],
source_related_uid
=
task_uid_list
,
select_
expression
=
'portal_type, relative_url, id, title'
,
select_
list
=
[
'portal_type'
,
'relative_url'
,
'id'
,
'title'
]
,
sort_on
=
((
'title'
,
'ascending'
),))
person_dict
=
{}
person_list
=
[]
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/TaskReportModule_generateProjectDomain.py
View file @
c208c12d
...
...
@@ -6,11 +6,11 @@ def Task_getRelatedSourceProject(depth, parent_relative_url=None):
task_uid_list
=
context
.
portal_selections
.
getSelectionUidList
(
context
=
context
,
selection_name
=
'task_report_module_selection'
)
project_result
=
context
.
portal_catalog
(
portal_type
=
[
"Project"
,
"Project Line"
],
source_project_related_uid
=
task_uid_list
,
select_
expression
=
'portal_type, relative_url, id, title'
,
select_
list
=
[
'portal_type'
,
'relative_url'
,
'id'
,
'title'
]
,
sort_on
=
((
'title'
,
'ascending'
),))
else
:
project_result
=
context
.
portal_catalog
(
portal_type
=
[
"Project Line"
,
"Project Milestones"
],
select_
expression
=
'portal_type, relative_url, id, title'
,
select_
list
=
[
'portal_type'
,
'relative_url'
,
'id'
,
'title'
]
,
parent_relative_url
=
parent_relative_url
,
sort_on
=
((
'title'
,
'ascending'
),))
# use a dict to store catalog result
...
...
bt5/erp5_tiosafe_oscommerce/ExtensionTemplateItem/OscommerceERP5NodeConduit.py
View file @
c208c12d
...
...
@@ -292,7 +292,10 @@ class OscommerceERP5NodeConduit(TioSafeBaseConduit):
address_list
=
document
.
searchFolder
(
portal_type
=
'Address'
,
sort_on
=
([
'id'
,
'ASC'
],),
where_expression
=
'id != "default_address"'
,
id
=
{
'query'
:
'default_address'
,
'operator'
:
'!='
,
},
)
try
:
address
=
address_list
[
address_index
].
getObject
()
...
...
@@ -385,7 +388,10 @@ class OscommerceERP5NodeConduit(TioSafeBaseConduit):
address_list
=
document
.
searchFolder
(
portal_type
=
'Address'
,
sort_on
=
([
'id'
,
'ASC'
],
),
where_expression
=
'id != "default_address"'
,
id
=
{
'query'
:
'default_address'
,
'operator'
:
'!='
,
},
)
address_id
=
address_list
[
address_index
].
getId
()
try
:
...
...
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_viewSubjectIndexRenderer.py
View file @
c208c12d
...
...
@@ -19,7 +19,7 @@ def buildIndex(language=None):
from
Products.ZSQLCatalog.SQLCatalog
import
NegatedQuery
,
Query
# Retrieve the different subjects in the catalog
subject_list
=
context
.
searchResults
(
select_
expression
=
'subject, reference'
,
select_
list
=
[
'subject'
,
'reference'
]
,
query
=
NegatedQuery
(
Query
(
subject
=
None
)),
language
=
language
or
''
,
sort_on
=
((
'subject'
,
'ascending'
),
(
'title'
,
'ascending'
)),
...
...
product/ERP5/Tool/SimulationTool.py
View file @
c208c12d
...
...
@@ -808,7 +808,7 @@ class SimulationTool(BaseTool):
if
where_expression
!=
''
:
add_kw
[
'where_expression'
]
=
where_expression
add_kw
[
'predicate_category.uid'
]
=
'!=NULL'
add_kw
[
'group_by
_expression'
]
=
'uid'
add_kw
[
'group_by
'
]
=
[
'uid'
]
add_query
=
self
.
portal_catalog
(
**
add_kw
)
uid_list
=
[]
for
line
in
add_query
:
...
...
product/ERP5/tests/testSupply.py
View file @
c208c12d
...
...
@@ -264,7 +264,7 @@ class TestSaleSupply(TestSupplyMixin, SubcontentReindexingWrapper,
kw
=
{}
kw
[
'predicate.uid'
]
=
supply_line
.
getUid
()
kw
[
'select_
expression'
]
=
'predicate.start_date_range_min'
kw
[
'select_
list'
]
=
[
'predicate.start_date_range_min'
]
# check supply line in predicate table
result
=
self
.
catalog_tool
(
**
kw
)
...
...
product/ERP5Catalog/CatalogTool.py
View file @
c208c12d
...
...
@@ -584,8 +584,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
security_uid_dict
=
{
None
:
[
x
.
security_uid
for
x
in
\
self
.
unrestrictedSearchResults
(
allowedRolesAndUsers
=
allowedRolesAndUsers
,
select_
expression
=
"security_uid"
,
group_by
_expression
=
"security_uid"
)]
}
select_
list
=
[
"security_uid"
]
,
group_by
=
[
"security_uid"
]
)]
}
else
:
# XXX: What with this string transformation ?! Souldn't it be done in
# dtml instead ? ... yes, but how to be bw compatible ?
...
...
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
c208c12d
...
...
@@ -3674,7 +3674,7 @@ VALUES
def
test_IndexationContextIndependence
(
self
):
def
doCatalog
(
catalog
,
document
):
catalog
.
catalogObjectList
([
document
],
check_uid
=
0
)
result
=
catalog
(
select_
expression
=
'reference'
,
uid
=
document
.
getUid
())
result
=
catalog
(
select_
list
=
[
'reference'
]
,
uid
=
document
.
getUid
())
self
.
assertEqual
(
len
(
result
),
1
)
return
result
[
0
].
reference
...
...
@@ -3720,8 +3720,10 @@ VALUES
self
.
tic
()
portal_catalog
=
self
.
getCatalogTool
()
res
=
portal_catalog
.
searchResults
(
select_expression
=
'count(DISTINCT catalog.reference) AS count_reference'
,
group_by_expression
=
'catalog.reference'
,
select_dict
=
{
'count_reference'
:
'count(DISTINCT reference)'
,
},
group_by
=
[
'reference'
],
portal_type
=
'Person'
,
)
self
.
assertEqual
(
1
,
len
(
res
))
...
...
product/ERP5TioSafe/Conduit/ERP5NodeConduit.py
View file @
c208c12d
...
...
@@ -347,7 +347,10 @@ class ERP5NodeConduit(TioSafeBaseConduit):
address_list
=
document
.
searchFolder
(
portal_type
=
'Address'
,
sort_on
=
([
'id'
,
'ASC'
],),
where_expression
=
'id != "default_address"'
,
id
=
{
'query'
:
'default_address'
,
'operator'
:
'!='
,
},
)
try
:
address
=
address_list
[
address_index
].
getObject
()
...
...
@@ -444,7 +447,10 @@ class ERP5NodeConduit(TioSafeBaseConduit):
address_list
=
document
.
searchFolder
(
portal_type
=
'Address'
,
sort_on
=
([
'id'
,
'ASC'
],
),
where_expression
=
'id != "default_address"'
,
id
=
{
'query'
:
'default_address'
,
'operator'
:
'!='
,
},
)
address_id
=
address_list
[
address_index
].
getId
()
try
:
...
...
product/ERP5eGovSecurity/EGOVUserManager.py
View file @
c208c12d
...
...
@@ -216,7 +216,7 @@ class EGOVUserManager(ERP5UserManager):
newSecurityManager
(
self
,
self
.
getUser
(
SUPER_USER
))
try
:
result
=
portal
.
portal_catalog
.
unrestrictedSearchResults
(
select_
expression
=
'reference'
,
select_
list
=
[
'reference'
]
,
portal_type
=
self
.
portal_type_list
,
reference
=
login
)
if
len
(
result
)
!=
1
:
# we won't proceed with groups
if
len
(
result
)
>
1
:
# configuration is screwed
...
...
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