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
08394e5a
Commit
08394e5a
authored
Feb 01, 2018
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder: use dedicated script to evaluate min stock
parent
9f64be1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
product/ERP5/mixin/builder.py
product/ERP5/mixin/builder.py
+11
-3
No files found.
product/ERP5/mixin/builder.py
View file @
08394e5a
...
...
@@ -391,9 +391,16 @@ class BuilderMixin(XMLObject, Amount, Predicate):
node_uid
=
supply
.
getDestinationUid
()
# XXX This should be bound to a stard and stop date
)
for
date
,
inventory
in
history_list
:
if
ordered_inventory
+
inventory
<
min_inventory
:
# SKU
quantity
=
min_inventory
-
inventory
-
ordered_inventory
while
history_list
:
date
,
inventory
,
quantity
=
history_list
[
0
]
min_inventory
=
self
.
Base_evaluateMinInventoryForSupplyAtDate
(
supply
=
supply
,
history_list
=
history_list
,
at_date
=
date
,
)
if
ordered_inventory
+
(
inventory
-
quantity
)
<
min_inventory
:
# SKU
#import pdb;pdb.set_trace()
quantity
=
min_inventory
-
(
inventory
-
quantity
)
-
ordered_inventory
ordered_quantity
,
ordered_unit
,
ordered_date
,
delivery_date
,
quantity
=
minimalQuantity
(
quantity
,
date
)
# XXX CLN This is very naive, it has to be optimized
if
ordered_date
<=
supply
.
getStartDateRangeMax
()
\
...
...
@@ -407,6 +414,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
ordered_unit
)
)
history_list
.
pop
(
0
)
return
movement_list
def
_searchMovementList
(
self
,
**
kw
):
...
...
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