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
ea1e6cd1
Commit
ea1e6cd1
authored
Mar 12, 2014
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inventories: take into account from_data parameter in getNextAlertInventoryDate
parent
43856635
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+6
-5
No files found.
product/ERP5/Tool/SimulationTool.py
View file @
ea1e6cd1
...
@@ -2050,7 +2050,8 @@ class SimulationTool(BaseTool):
...
@@ -2050,7 +2050,8 @@ class SimulationTool(BaseTool):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getNextDeficientInventoryDate'
)
'getNextDeficientInventoryDate'
)
def
getNextAlertInventoryDate
(
self
,
reference_quantity
=
0
,
src__
=
0
,
**
kw
):
def
getNextAlertInventoryDate
(
self
,
reference_quantity
=
0
,
src__
=
0
,
from_date
=
None
,
**
kw
):
"""
"""
Give the next date where the quantity is lower than the
Give the next date where the quantity is lower than the
reference quantity.
reference quantity.
...
@@ -2058,16 +2059,16 @@ class SimulationTool(BaseTool):
...
@@ -2058,16 +2059,16 @@ class SimulationTool(BaseTool):
result
=
None
result
=
None
# First look at current inventory, we might have already an inventory
# First look at current inventory, we might have already an inventory
# lower than reference_quantity
# lower than reference_quantity
current_inventory
=
self
.
get
CurrentInventory
(
**
kw
)
current_inventory
=
self
.
get
Inventory
(
at_date
=
from_date
,
**
kw
)
if
current_inventory
<
reference_quantity
:
if
current_inventory
<
reference_quantity
:
result
=
DateTime
()
result
=
DateTime
()
else
:
else
:
result
=
self
.
getInventoryList
(
src__
=
src__
,
inventory_list
=
self
.
getInventoryList
(
src__
=
src__
,
from_date
=
from_date
,
sort_on
=
((
'date'
,
'ascending'
),),
group_by_movement
=
1
,
**
kw
)
sort_on
=
((
'date'
,
'ascending'
),),
group_by_movement
=
1
,
**
kw
)
if
src__
:
if
src__
:
return
resul
t
return
inventory_lis
t
total_inventory
=
0.
total_inventory
=
0.
for
inventory
in
resul
t
:
for
inventory
in
inventory_lis
t
:
if
inventory
[
'inventory'
]
is
not
None
:
if
inventory
[
'inventory'
]
is
not
None
:
total_inventory
+=
inventory
[
'inventory'
]
total_inventory
+=
inventory
[
'inventory'
]
if
total_inventory
<
reference_quantity
:
if
total_inventory
<
reference_quantity
:
...
...
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