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
Labels
Merge Requests
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
9e530f6a
Commit
9e530f6a
authored
May 21, 2014
by
Jérome Perrin
Committed by
Xiaowu Zhang
Sep 26, 2019
7
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trade model path patch (see comments)
parent
7ae2b36f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
9 deletions
+32
-9
product/ERP5/Document/TradeModelPath.py
product/ERP5/Document/TradeModelPath.py
+32
-9
No files found.
product/ERP5/Document/TradeModelPath.py
View file @
9e530f6a
...
...
@@ -160,6 +160,11 @@ class TradeModelPath(Path):
)
# XXX-JPS UNkonwn ?
# AACT Specific: in getArrowCategory, if we use a script to set categories
# dynamically, the script have to return all categories. In default
# implementation, if the script does not return a value for a given category,
# this category is taken from input movement. We don't want that, otherwise no
# way to unset a category
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getArrowCategoryDict'
)
def
getArrowCategoryDict
(
self
,
context
=
None
,
**
kw
):
# XXX-JPS do we need it in API ?
...
...
@@ -170,15 +175,33 @@ class TradeModelPath(Path):
# dynamically computed values (if not exist).
result
=
{}
dynamic_category_list
=
self
.
_getDynamicCategoryList
(
context
)
for
base_category
in
self
.
getSourceArrowBaseCategoryList
()
+
\
self
.
getDestinationArrowBaseCategoryList
():
category_url_list
=
self
.
_getAcquiredCategoryMembershipList
(
base_category
,
**
kw
)
if
len
(
category_url_list
)
==
0
and
len
(
dynamic_category_list
)
>
0
:
category_url_list
=
self
.
_filterCategoryList
(
dynamic_category_list
,
base_category
,
**
kw
)
if
len
(
category_url_list
)
>
0
:
result
[
base_category
]
=
category_url_list
for
base_category
in
self
.
getSourceArrowBaseCategoryList
():
if
self
.
getSourceMethodId
()
and
context
is
not
None
:
result
[
base_category
]
=
self
.
_filterCategoryList
(
dynamic_category_list
,
base_category
,
**
kw
)
else
:
category_url_list
=
Path
.
_getAcquiredCategoryMembershipList
(
self
,
base_category
,
**
kw
)
if
len
(
category_url_list
)
==
0
and
context
is
not
None
:
category_url_list
=
self
.
_filterCategoryList
(
dynamic_category_list
,
base_category
,
**
kw
)
if
len
(
category_url_list
)
>
0
:
result
[
base_category
]
=
category_url_list
for
base_category
in
self
.
getDestinationArrowBaseCategoryList
():
if
self
.
getDestinationMethodId
()
and
context
is
not
None
:
result
[
base_category
]
=
self
.
_filterCategoryList
(
dynamic_category_list
,
base_category
,
**
kw
)
else
:
category_url_list
=
Path
.
_getAcquiredCategoryMembershipList
(
self
,
base_category
,
**
kw
)
if
len
(
category_url_list
)
==
0
and
context
is
not
None
:
category_url_list
=
self
.
_filterCategoryList
(
dynamic_category_list
,
base_category
,
**
kw
)
if
len
(
category_url_list
)
>
0
:
result
[
base_category
]
=
category_url_list
return
result
def
_filterCategoryList
(
self
,
category_list
,
category
,
spec
=
(),
...
...
Xiaowu Zhang
@xiaowu.zhang
mentioned in commit
5f5bea1a
·
Apr 06, 2020
mentioned in commit
5f5bea1a
mentioned in commit 5f5bea1abb469c533434ef0395bbca71e319c1f7
Toggle commit list
Xiaowu Zhang
@xiaowu.zhang
mentioned in commit
c9be3089
·
Apr 06, 2020
mentioned in commit
c9be3089
mentioned in commit c9be3089a850b9daaff49d6f113c37d138b9ee68
Toggle commit 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