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
Noah Brackenbury
erp5
Commits
b91911f9
Commit
b91911f9
authored
May 21, 2014
by
Jérome Perrin
Committed by
Klaus Wölfel
Mar 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trade model path patch (see comments)
parent
30508c74
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 @
b91911f9
...
...
@@ -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
=
(),
...
...
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