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
8304e68e
Commit
8304e68e
authored
Aug 30, 2011
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in case of total_quantity==0, the some of delivery_ratio should be specified value.
also cast delivery_ratio to float for safety.
parent
0a394578
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
product/ERP5/MovementGroup.py
product/ERP5/MovementGroup.py
+2
-2
No files found.
product/ERP5/MovementGroup.py
View file @
8304e68e
...
...
@@ -362,10 +362,10 @@ class FakeMovement:
if
total_quantity
!=
0
:
for
movement
in
self
.
__movement_list
:
quantity
=
movement
.
getMappedProperty
(
'quantity'
)
movement
.
edit
(
delivery_ratio
=
quantity
*
delivery_ratio
/
total_quantity
)
movement
.
edit
(
delivery_ratio
=
quantity
*
float
(
delivery_ratio
)
/
total_quantity
)
else
:
# Distribute equally ratio to all movement
mvt_ratio
=
1.
/
len
(
self
.
__movement_list
)
mvt_ratio
=
float
(
delivery_ratio
)
/
len
(
self
.
__movement_list
)
for
movement
in
self
.
__movement_list
:
movement
.
edit
(
delivery_ratio
=
mvt_ratio
)
...
...
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