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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tomáš Peterka
erp5
Commits
41eb6265
Commit
41eb6265
authored
Mar 09, 2015
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventories: getNextAlertInventoryDate was not handling properly simulation states
parent
fea98212
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+6
-3
No files found.
product/ERP5/Tool/SimulationTool.py
View file @
41eb6265
...
@@ -2051,7 +2051,7 @@ class SimulationTool(BaseTool):
...
@@ -2051,7 +2051,7 @@ class SimulationTool(BaseTool):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getNextDeficientInventoryDate'
)
'getNextDeficientInventoryDate'
)
def
getNextAlertInventoryDate
(
self
,
reference_quantity
=
0
,
src__
=
0
,
def
getNextAlertInventoryDate
(
self
,
reference_quantity
=
0
,
src__
=
0
,
from_date
=
None
,
**
kw
):
simulation_period
=
'Future'
,
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.
...
@@ -2061,11 +2061,14 @@ class SimulationTool(BaseTool):
...
@@ -2061,11 +2061,14 @@ class SimulationTool(BaseTool):
# lower than reference_quantity
# lower than reference_quantity
if
from_date
is
None
:
if
from_date
is
None
:
from_date
=
DateTime
()
from_date
=
DateTime
()
current_inventory
=
self
.
getInventory
(
at_date
=
from_date
,
**
kw
)
inventory_method
=
getattr
(
self
,
"get%sInventory"
%
simulation_period
)
current_inventory
=
inventory_method
(
at_date
=
from_date
,
**
kw
)
if
current_inventory
<
reference_quantity
:
if
current_inventory
<
reference_quantity
:
result
=
from_date
result
=
from_date
else
:
else
:
inventory_list
=
self
.
getInventoryList
(
src__
=
src__
,
from_date
=
from_date
,
inventory_list_method
=
getattr
(
self
,
"get%sInventoryList"
%
simulation_period
)
inventory_list
=
inventory_list_method
(
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
inventory_list
return
inventory_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