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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leo Le Bouter
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():
draft_solver_process
=
solver_process
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
)
else
:
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 @@
</item>
<item>
<key>
<string>
line_groupable
</string>
</key>
<value>
<int>
0
</int>
</value>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
permission
</string>
</key>
...
...
bt5/erp5_configurator_standard_solver/PathTemplateItem/portal_solvers/Quantity%20Split%20Solver.xml
View file @
38f33857
...
...
@@ -67,17 +67,29 @@
</value>
</item>
<item>
<key>
<string>
_
mt_index
</string>
</key>
<key>
<string>
_
identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_
tree
</string>
</key>
<key>
<string>
_
mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</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>
<key>
<string>
acquire_local_roles
</string>
</key>
<value>
<int>
1
</int>
</value>
...
...
@@ -136,17 +148,13 @@
<none/>
</value>
</item>
<item>
<key>
<string>
last_id
</string>
</key>
<value>
<string>
2
</string>
</value>
</item>
<item>
<key>
<string>
line_exclusive
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
line_groupable
</string>
</key>
<value>
<int>
0
</int>
</value>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
permission
</string>
</key>
...
...
@@ -166,6 +174,10 @@
<key>
<string>
solver_action_title
</string>
</key>
<value>
<string>
Split and Differ
</string>
</value>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
QuantitySplitSolver
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
...
...
@@ -176,6 +188,21 @@
<pickle>
<int>
0
</int>
</pickle>
</record>
<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>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
...
...
@@ -183,7 +210,22 @@
<none/>
</pickle>
</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>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
...
...
product/ERP5/Document/FIFODeliverySolver.py
View file @
38f33857
...
...
@@ -77,22 +77,25 @@ class FIFODeliverySolver(XMLObject):
return
result
simulation_movement_list
=
self
.
_getSimulationMovementList
()
for
movement
in
simulation_movement_list
:
if
remaining_quantity
:
quantity
=
movement
.
getQuantity
()
if
quantity
<
remaining_quantity
:
result
.
append
((
movement
,
quantity
))
remaining_quantity
-=
quantity
movement
.
edit
(
quantity
=
0
,
delivery_ratio
=
0
,
activate_kw
=
activate_kw
)
else
:
quantity
=
movement
.
getQuantity
()
if
quantity
<
remaining_quantity
:
result
.
append
((
movement
,
quantity
))
remaining_quantity
-=
quantity
movement
.
edit
(
quantity
=
0
,
delivery_ratio
=
0
,
activate_kw
=
activate_kw
)
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
))
movement_quantity
=
quantity
-
remaining_quantity
delivery_ratio
=
1.
if
new_quantity
:
delivery_ratio
=
movement_quantity
/
new_quantity
movement
.
edit
(
quantity
=
movement_quantity
,
delivery_ratio
=
delivery_ratio
,
activate_kw
=
activate_kw
)
remaining_quantity
=
0
movement_quantity
=
quantity
-
remaining_quantity
delivery_ratio
=
1.
if
new_quantity
:
delivery_ratio
=
movement_quantity
/
new_quantity
movement
.
edit
(
quantity
=
movement_quantity
,
delivery_ratio
=
delivery_ratio
,
activate_kw
=
activate_kw
)
remaining_quantity
=
0
# Return movement, split_quantity tuples
return
result
...
...
@@ -103,6 +106,6 @@ class FIFODeliverySolver(XMLObject):
simulation_movement_list
=
self
.
getDeliveryValueList
()
if
len
(
simulation_movement_list
)
>
1
:
return
sorted
(
simulation_movement_list
,
key
=
lambda
x
:
x
.
getExpla
i
nationValue
().
getStartDate
(),
reverse
=
True
)
key
=
lambda
x
:
x
.
getExplanationValue
().
getStartDate
(),
reverse
=
True
)
else
:
return
simulation_movement_list
product/ERP5/Document/LIFODeliverySolver.py
View file @
38f33857
...
...
@@ -63,6 +63,6 @@ class LIFODeliverySolver(FIFODeliverySolver):
simulation_movement_list
=
self
.
getDeliveryValueList
()
if
len
(
simulation_movement_list
)
>
1
:
return
sorted
(
simulation_movement_list
,
key
=
lambda
x
:
x
.
getExpla
i
nationValue
().
getStartDate
())
key
=
lambda
x
:
x
.
getExplanationValue
().
getStartDate
())
else
:
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