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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
edc87797
Commit
edc87797
authored
Dec 08, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make domain tool do an unrestricted catalog search where getting applicable rules
parent
9e84b6ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
product/ERP5/Tool/DomainTool.py
product/ERP5/Tool/DomainTool.py
+13
-6
product/ERP5/Tool/RuleTool.py
product/ERP5/Tool/RuleTool.py
+1
-1
No files found.
product/ERP5/Tool/DomainTool.py
View file @
edc87797
...
@@ -57,11 +57,15 @@ class DomainTool(BaseTool):
...
@@ -57,11 +57,15 @@ class DomainTool(BaseTool):
# XXX FIXME method should not be public
# XXX FIXME method should not be public
# (some users are not able to see resource's price)
# (some users are not able to see resource's price)
security
.
declarePublic
(
'searchPredicateList'
)
security
.
declarePublic
(
'searchPredicateList'
)
def
searchPredicateList
(
self
,
context
,
test
=
1
,
sort_method
=
None
,
def
searchPredicateList
(
self
,
*
args
,
**
kw
):
ignored_category_list
=
None
,
return
self
.
_searchPredicateList
(
restricted
=
True
,
*
args
,
**
kw
)
tested_base_category_list
=
None
,
filter_method
=
None
,
acquired
=
1
,
def
_searchPredicateList
(
self
,
context
,
test
=
1
,
sort_method
=
None
,
strict
=
True
,
sort_key_method
=
None
,
query
=
None
,
**
kw
):
ignored_category_list
=
None
,
tested_base_category_list
=
None
,
filter_method
=
None
,
acquired
=
1
,
strict
=
True
,
sort_key_method
=
None
,
query
=
None
,
restricted
=
False
,
**
kw
):
# XXX: about "strict" parameter: This is a transition parameter,
# XXX: about "strict" parameter: This is a transition parameter,
# allowing someone hitting a bug to revert to original behaviour easily.
# allowing someone hitting a bug to revert to original behaviour easily.
# It is not a correct name, as pointed out by Jerome. But instead of
# It is not a correct name, as pointed out by Jerome. But instead of
...
@@ -231,7 +235,10 @@ class DomainTool(BaseTool):
...
@@ -231,7 +235,10 @@ class DomainTool(BaseTool):
if
query_list
:
if
query_list
:
kw
[
'query'
]
=
ComplexQuery
(
logical_operator
=
'AND'
,
*
query_list
)
kw
[
'query'
]
=
ComplexQuery
(
logical_operator
=
'AND'
,
*
query_list
)
sql_result_list
=
portal_catalog
.
searchResults
(
**
kw
)
if
restricted
:
sql_result_list
=
portal_catalog
.
searchResults
(
**
kw
)
else
:
sql_result_list
=
portal_catalog
.
unrestrictedSearchResults
(
**
kw
)
if
kw
.
get
(
'src__'
):
if
kw
.
get
(
'src__'
):
return
sql_result_list
return
sql_result_list
result_list
=
[]
result_list
=
[]
...
...
product/ERP5/Tool/RuleTool.py
View file @
edc87797
...
@@ -116,7 +116,7 @@ class RuleTool(BaseTool):
...
@@ -116,7 +116,7 @@ class RuleTool(BaseTool):
# We don't know why it failed so let searchPredicateList do the work.
# We don't know why it failed so let searchPredicateList do the work.
rule_uid_list
.
append
(
rule
.
getUid
())
rule_uid_list
.
append
(
rule
.
getUid
())
return
rule_uid_list
and
portal
.
portal_domains
.
searchPredicateList
(
return
rule_uid_list
and
portal
.
portal_domains
.
_
searchPredicateList
(
context
=
movement
,
uid
=
rule_uid_list
,
context
=
movement
,
uid
=
rule_uid_list
,
tested_base_category_list
=
tested_base_category_list
)
tested_base_category_list
=
tested_base_category_list
)
...
...
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