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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
a2c89713
Commit
a2c89713
authored
Feb 18, 2019
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Mar 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder: Supply builder check date movement before integrating it
parent
31a57069
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
...TemplateItem/portal_components/mixin.erp5.BuilderMixin.py
+11
-7
No files found.
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
View file @
a2c89713
...
@@ -453,12 +453,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
...
@@ -453,12 +453,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
# Prepare period_list
# Prepare period_list
limit_date
=
getPreviousValidDate
(
getPreviousValidDate
(
from_date
)
-
0.1
)
limit_date
=
getPreviousValidDate
(
getPreviousValidDate
(
from_date
)
-
0.1
)
# evaluate future inventory at date
future_inventory_to_date
=
portal
.
portal_simulation
.
getFutureInventory
(
to_date
=
limit_date
,
resource_uid
=
resource_value
.
getUid
(),
node_uid
=
supply
.
getDestinationUid
(),
)
limit_date_list
=
[]
limit_date_list
=
[]
last_date
=
getPreviousValidDate
(
history_list
[
-
1
][
0
])
last_date
=
getPreviousValidDate
(
history_list
[
-
1
][
0
])
while
limit_date
<=
last_date
:
while
limit_date
<=
last_date
:
...
@@ -468,6 +462,13 @@ class BuilderMixin(XMLObject, Amount, Predicate):
...
@@ -468,6 +462,13 @@ class BuilderMixin(XMLObject, Amount, Predicate):
# Hackish and dangerous
# Hackish and dangerous
next_start_date
=
limit_date
)).
earliestTime
()
next_start_date
=
limit_date
)).
earliestTime
()
# evaluate future inventory at date
future_inventory_to_date
=
portal
.
portal_simulation
.
getFutureInventory
(
to_date
=
limit_date_list
[
0
],
resource_uid
=
resource_value
.
getUid
(),
node_uid
=
supply
.
getDestinationUid
(),
)
min_stock_value
=
supply
.
getMinOrderQuantity
()
/
default_quantity_unit_flow_quantity_unit_conversion_ratio
min_stock_value
=
supply
.
getMinOrderQuantity
()
/
default_quantity_unit_flow_quantity_unit_conversion_ratio
factor
=
supply
.
getMinFlow
()
factor
=
supply
.
getMinFlow
()
next_period_history_list
=
[]
next_period_history_list
=
[]
...
@@ -485,6 +486,9 @@ class BuilderMixin(XMLObject, Amount, Predicate):
...
@@ -485,6 +486,9 @@ class BuilderMixin(XMLObject, Amount, Predicate):
next_next_period_start_date
==
next_period_start_date
:
next_next_period_start_date
==
next_period_start_date
:
period_history_list
=
next_period_history_list
[:]
period_history_list
=
next_period_history_list
[:]
while
history_list
and
history_list
[
0
][
0
]
<
next_period_start_date
:
while
history_list
and
history_list
[
0
][
0
]
<
next_period_start_date
:
if
history_list
[
0
][
0
]
<
period_start_date
:
history_list
.
pop
(
0
)
else
:
period_history_list
.
append
(
history_list
.
pop
(
0
))
period_history_list
.
append
(
history_list
.
pop
(
0
))
# Using period history list calculate min stock
# Using period history list calculate min stock
...
...
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