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
Tatuya Kamada
erp5
Commits
2674ce84
Commit
2674ce84
authored
Nov 15, 2011
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if base_application really matches in getGeneratedAmountList().
parent
6f63d5bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
product/ERP5/mixin/amount_generator.py
product/ERP5/mixin/amount_generator.py
+25
-1
No files found.
product/ERP5/mixin/amount_generator.py
View file @
2674ce84
...
...
@@ -370,7 +370,31 @@ class AmountGeneratorMixin:
# Browse recursively the amount generator lines and accumulate
# applicable values - now execute the method
accumulateAmountList
(
self
)
return
result
# finally check if base_application matches with input or other
# generated amounts, because we no longer ignore 'quantity==0'
# amount thus non-matched amount can exist here.
delivery_contribution_list
=
self
.
getBaseContributionList
()
index_list
=
range
(
len
(
result
))
application_set_list
=
[
set
(
result
[
i
].
getBaseApplicationList
())
for
i
in
index_list
]
contribution_list_list
=
[
result
[
i
].
getBaseContributionList
()
for
i
in
index_list
]
bad_index_list
=
[]
good_index_list
=
[]
flag
=
True
while
flag
:
flag
=
False
for
i
in
index_list
:
if
i
in
bad_index_list
or
i
in
good_index_list
:
continue
if
application_set_list
[
i
].
intersection
(
delivery_contribution_list
):
good_index_list
.
append
(
i
)
continue
if
application_set_list
[
i
].
intersection
(
sum
([
contribution_list_list
[
j
]
for
j
in
index_list
if
j
!=
i
and
j
not
in
bad_index_list
],
[])):
continue
flag
=
True
bad_index_list
.
append
(
i
)
return
[
result
[
i
]
for
i
in
index_list
if
i
not
in
bad_index_list
]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getAggregatedAmountList'
)
...
...
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