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
Nicolas Wavrant
erp5
Commits
38f33857
Commit
38f33857
authored
Oct 19, 2017
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simulation: fix FIFO and FILO solvers, they were unable to work with several movements
parent
521b48ad
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
26 deletions
+74
-26
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_diverge.py
...w/delivery_causality_workflow/scripts/Delivery_diverge.py
+3
-0
bt5/erp5_configurator_standard_solver/PathTemplateItem/portal_solvers/Quantity%20Split%20Move%20Solver.xml
...eItem/portal_solvers/Quantity%20Split%20Move%20Solver.xml
+1
-1
bt5/erp5_configurator_standard_solver/PathTemplateItem/portal_solvers/Quantity%20Split%20Solver.xml
...TemplateItem/portal_solvers/Quantity%20Split%20Solver.xml
+50
-8
product/ERP5/Document/FIFODeliverySolver.py
product/ERP5/Document/FIFODeliverySolver.py
+19
-16
product/ERP5/Document/LIFODeliverySolver.py
product/ERP5/Document/LIFODeliverySolver.py
+1
-1
No files found.
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_diverge.py
View file @
38f33857
...
@@ -9,6 +9,9 @@ for solver_process in delivery.getSolverValueList():
...
@@ -9,6 +9,9 @@ for solver_process in delivery.getSolverValueList():
draft_solver_process
=
solver_process
draft_solver_process
=
solver_process
if
draft_solver_process
is
not
None
:
if
draft_solver_process
is
not
None
:
# Fully clean it to avoid having some solver decisions in double
id_list
=
[
x
for
x
in
draft_solver_process
.
objectIds
()]
draft_solver_process
.
manage_delObjects
(
ids
=
id_list
)
draft_solver_process
.
buildSolverDecisionList
(
delivery
)
draft_solver_process
.
buildSolverDecisionList
(
delivery
)
else
:
else
:
delivery
.
getPortalObject
().
portal_solver_processes
.
newSolverProcess
(
delivery
)
delivery
.
getPortalObject
().
portal_solver_processes
.
newSolverProcess
(
delivery
)
bt5/erp5_configurator_standard_solver/PathTemplateItem/portal_solvers/Quantity%20Split%20Move%20Solver.xml
View file @
38f33857
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
line_groupable
</string>
</key>
<key>
<string>
line_groupable
</string>
</key>
<value>
<int>
0
</int>
</value>
<value>
<int>
1
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
permission
</string>
</key>
<key>
<string>
permission
</string>
</key>
...
...
bt5/erp5_configurator_standard_solver/PathTemplateItem/portal_solvers/Quantity%20Split%20Solver.xml
View file @
38f33857
...
@@ -67,17 +67,29 @@
...
@@ -67,17 +67,29 @@
</value>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_
mt_index
</string>
</key>
<key>
<string>
_
identity_criterion
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_
tree
</string>
</key>
<key>
<string>
_
mt_index
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAY=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
acquire_local_roles
</string>
</key>
<key>
<string>
acquire_local_roles
</string>
</key>
<value>
<int>
1
</int>
</value>
<value>
<int>
1
</int>
</value>
...
@@ -136,17 +148,13 @@
...
@@ -136,17 +148,13 @@
<none/>
<none/>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
last_id
</string>
</key>
<value>
<string>
2
</string>
</value>
</item>
<item>
<item>
<key>
<string>
line_exclusive
</string>
</key>
<key>
<string>
line_exclusive
</string>
</key>
<value>
<int>
0
</int>
</value>
<value>
<int>
0
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
line_groupable
</string>
</key>
<key>
<string>
line_groupable
</string>
</key>
<value>
<int>
0
</int>
</value>
<value>
<int>
1
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
permission
</string>
</key>
<key>
<string>
permission
</string>
</key>
...
@@ -166,6 +174,10 @@
...
@@ -166,6 +174,10 @@
<key>
<string>
solver_action_title
</string>
</key>
<key>
<string>
solver_action_title
</string>
</key>
<value>
<string>
Split and Differ
</string>
</value>
<value>
<string>
Split and Differ
</string>
</value>
</item>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
QuantitySplitSolver
</string>
</value>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
...
@@ -176,6 +188,21 @@
...
@@ -176,6 +188,21 @@
<pickle>
<int>
0
</int>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
</pickle>
...
@@ -183,7 +210,22 @@
...
@@ -183,7 +210,22 @@
<none/>
<none/>
</pickle>
</pickle>
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"6"
aka=
"AAAAAAAAAAY="
>
<pickle>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
</pickle>
...
...
product/ERP5/Document/FIFODeliverySolver.py
View file @
38f33857
...
@@ -77,22 +77,25 @@ class FIFODeliverySolver(XMLObject):
...
@@ -77,22 +77,25 @@ class FIFODeliverySolver(XMLObject):
return
result
return
result
simulation_movement_list
=
self
.
_getSimulationMovementList
()
simulation_movement_list
=
self
.
_getSimulationMovementList
()
for
movement
in
simulation_movement_list
:
for
movement
in
simulation_movement_list
:
if
remaining_quantity
:
quantity
=
movement
.
getQuantity
()
quantity
=
movement
.
getQuantity
()
if
quantity
<
remaining_quantity
:
if
quantity
<
remaining_quantity
:
result
.
append
((
movement
,
quantity
))
result
.
append
((
movement
,
quantity
))
remaining_quantity
-=
quantity
remaining_quantity
-=
quantity
movement
.
edit
(
quantity
=
0
,
delivery_ratio
=
0
,
activate_kw
=
activate_kw
)
movement
.
edit
(
quantity
=
0
,
delivery_ratio
=
0
,
activate_kw
=
activate_kw
)
else
:
else
:
# only append movement if we decrease the quantity, which means we
# would surely split it. If remaining quantity is 0, the code is
# just used to update delivery ratio
if
remaining_quantity
:
result
.
append
((
movement
,
remaining_quantity
))
result
.
append
((
movement
,
remaining_quantity
))
movement_quantity
=
quantity
-
remaining_quantity
movement_quantity
=
quantity
-
remaining_quantity
delivery_ratio
=
1.
delivery_ratio
=
1.
if
new_quantity
:
if
new_quantity
:
delivery_ratio
=
movement_quantity
/
new_quantity
delivery_ratio
=
movement_quantity
/
new_quantity
movement
.
edit
(
quantity
=
movement_quantity
,
movement
.
edit
(
quantity
=
movement_quantity
,
delivery_ratio
=
delivery_ratio
,
delivery_ratio
=
delivery_ratio
,
activate_kw
=
activate_kw
)
activate_kw
=
activate_kw
)
remaining_quantity
=
0
remaining_quantity
=
0
# Return movement, split_quantity tuples
# Return movement, split_quantity tuples
return
result
return
result
...
@@ -103,6 +106,6 @@ class FIFODeliverySolver(XMLObject):
...
@@ -103,6 +106,6 @@ class FIFODeliverySolver(XMLObject):
simulation_movement_list
=
self
.
getDeliveryValueList
()
simulation_movement_list
=
self
.
getDeliveryValueList
()
if
len
(
simulation_movement_list
)
>
1
:
if
len
(
simulation_movement_list
)
>
1
:
return
sorted
(
simulation_movement_list
,
return
sorted
(
simulation_movement_list
,
key
=
lambda
x
:
x
.
getExpla
i
nationValue
().
getStartDate
(),
reverse
=
True
)
key
=
lambda
x
:
x
.
getExplanationValue
().
getStartDate
(),
reverse
=
True
)
else
:
else
:
return
simulation_movement_list
return
simulation_movement_list
product/ERP5/Document/LIFODeliverySolver.py
View file @
38f33857
...
@@ -63,6 +63,6 @@ class LIFODeliverySolver(FIFODeliverySolver):
...
@@ -63,6 +63,6 @@ class LIFODeliverySolver(FIFODeliverySolver):
simulation_movement_list
=
self
.
getDeliveryValueList
()
simulation_movement_list
=
self
.
getDeliveryValueList
()
if
len
(
simulation_movement_list
)
>
1
:
if
len
(
simulation_movement_list
)
>
1
:
return
sorted
(
simulation_movement_list
,
return
sorted
(
simulation_movement_list
,
key
=
lambda
x
:
x
.
getExpla
i
nationValue
().
getStartDate
())
key
=
lambda
x
:
x
.
getExplanationValue
().
getStartDate
())
else
:
else
:
return
simulation_movement_list
return
simulation_movement_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