Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
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
Show 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):
# XXX FIXME method should not be public
# (some users are not able to see resource's price)
security
.
declarePublic
(
'searchPredicateList'
)
def
searchPredicateList
(
self
,
context
,
test
=
1
,
sort_method
=
None
,
def
searchPredicateList
(
self
,
*
args
,
**
kw
):
return
self
.
_searchPredicateList
(
restricted
=
True
,
*
args
,
**
kw
)
def
_searchPredicateList
(
self
,
context
,
test
=
1
,
sort_method
=
None
,
ignored_category_list
=
None
,
tested_base_category_list
=
None
,
filter_method
=
None
,
acquired
=
1
,
strict
=
True
,
sort_key_method
=
None
,
query
=
None
,
**
kw
):
strict
=
True
,
sort_key_method
=
None
,
query
=
None
,
restricted
=
False
,
**
kw
):
# XXX: about "strict" parameter: This is a transition parameter,
# 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
...
...
@@ -231,7 +235,10 @@ class DomainTool(BaseTool):
if
query_list
:
kw
[
'query'
]
=
ComplexQuery
(
logical_operator
=
'AND'
,
*
query_list
)
if
restricted
:
sql_result_list
=
portal_catalog
.
searchResults
(
**
kw
)
else
:
sql_result_list
=
portal_catalog
.
unrestrictedSearchResults
(
**
kw
)
if
kw
.
get
(
'src__'
):
return
sql_result_list
result_list
=
[]
...
...
product/ERP5/Tool/RuleTool.py
View file @
edc87797
...
...
@@ -116,7 +116,7 @@ class RuleTool(BaseTool):
# We don't know why it failed so let searchPredicateList do the work.
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
,
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