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
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
Boxiang Sun
erp5
Commits
45f7c33b
Commit
45f7c33b
authored
Feb 27, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix getFutureTrackingList for movements in started state
parent
57cf5cdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+5
-2
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+28
-1
No files found.
product/ERP5/Tool/SimulationTool.py
View file @
45f7c33b
...
@@ -2162,8 +2162,11 @@ class SimulationTool(BaseTool):
...
@@ -2162,8 +2162,11 @@ class SimulationTool(BaseTool):
"""
"""
Returns list of future inventory grouped by section or site
Returns list of future inventory grouped by section or site
"""
"""
kw
[
'item.simulation_state'
]
=
tuple
(
list
(
self
.
getPortalFutureInventoryStateList
())
kw
[
'item.simulation_state'
]
=
tuple
(
+
list
(
self
.
getPortalReservedInventoryStateList
())
+
list
(
self
.
getPortalCurrentInventoryStateList
()))
list
(
self
.
getPortalFutureInventoryStateList
())
+
\
list
(
self
.
getPortalTransitInventoryStateList
())
+
\
list
(
self
.
getPortalReservedInventoryStateList
())
+
\
list
(
self
.
getPortalCurrentInventoryStateList
()))
return
self
.
getTrackingList
(
**
kw
)
return
self
.
getTrackingList
(
**
kw
)
#######################################################
#######################################################
...
...
product/ERP5/tests/testInventoryAPI.py
View file @
45f7c33b
...
@@ -2253,7 +2253,7 @@ class TestInventoryStat(InventoryAPITestCase):
...
@@ -2253,7 +2253,7 @@ class TestInventoryStat(InventoryAPITestCase):
self
.
assertEquals
(
getInventoryStat
(
node_uid
=
node_uid
)[
0
].
stock_uid
,
3
)
self
.
assertEquals
(
getInventoryStat
(
node_uid
=
node_uid
)[
0
].
stock_uid
,
3
)
class
TestTrackingList
(
InventoryAPITestCase
):
class
TestTrackingList
(
InventoryAPITestCase
):
"""Tests I
nventory Stat methods.
"""Tests I
tem Tracking
"""
"""
def
testNodeUid
(
self
):
def
testNodeUid
(
self
):
getTrackingList
=
self
.
getSimulationTool
().
getTrackingList
getTrackingList
=
self
.
getSimulationTool
().
getTrackingList
...
@@ -2351,6 +2351,33 @@ class TestTrackingList(InventoryAPITestCase):
...
@@ -2351,6 +2351,33 @@ class TestTrackingList(InventoryAPITestCase):
'%s=now - %i, aggregate should be at node %i but is at node %i'
%
\
'%s=now - %i, aggregate should be at node %i but is at node %i'
%
\
(
param_id
,
now
-
date
,
node_uid_to_node_number
[
location_uid
],
node_uid_to_node_number
[
uid_list
[
0
]]))
(
param_id
,
now
-
date
,
node_uid_to_node_number
[
location_uid
],
node_uid_to_node_number
[
uid_list
[
0
]]))
def
testFutureTrackingList
(
self
):
movement
=
self
.
_makeMovement
(
quantity
=
1
,
aggregate_value
=
self
.
item
,)
getFutureTrackingList
=
self
.
portal
.
portal_simulation
.
getFutureTrackingList
node_uid
=
self
.
node
.
getUid
()
for
state
in
(
'planned'
,
'ordered'
,
'confirmed'
,
'ready'
,
'started'
,
'stopped'
,
'delivered'
):
movement
.
simulation_state
=
state
movement
.
reindexObject
()
self
.
tic
()
tracking_node_uid_list
=
[
brain
.
node_uid
for
brain
in
getFutureTrackingList
(
item
=
self
.
item
.
getRelativeUrl
())]
self
.
assertEquals
([
node_uid
],
tracking_node_uid_list
,
"%s != %s (state:%s)"
%
([
node_uid
],
tracking_node_uid_list
,
state
))
for
state
in
(
'draft'
,
'cancelled'
,
'deleted'
):
movement
.
simulation_state
=
state
movement
.
reindexObject
()
self
.
tic
()
tracking_node_uid_list
=
[
brain
.
node_uid
for
brain
in
getFutureTrackingList
(
item
=
self
.
item
.
getRelativeUrl
())]
self
.
assertEquals
([],
tracking_node_uid_list
,
"%s != %s (state:%s)"
%
([],
tracking_node_uid_list
,
state
))
# TODO: missing tests for input=1 and output=1
class
TestInventoryCacheTable
(
InventoryAPITestCase
):
class
TestInventoryCacheTable
(
InventoryAPITestCase
):
""" Test impact of creating cache entries into inventory_cache table
""" Test impact of creating cache entries into inventory_cache table
This is an optimisation on stock results to avoid reading all stock entries
This is an optimisation on stock results to avoid reading all stock entries
...
...
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