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
41e8ad8d
Commit
41e8ad8d
authored
Sep 12, 2012
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test to make sure that cancelling delivered inventory changes existing stock table records.
parent
f9ad726b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
product/ERP5/tests/testInventory.py
product/ERP5/tests/testInventory.py
+45
-0
No files found.
product/ERP5/tests/testInventory.py
View file @
41e8ad8d
...
@@ -1971,6 +1971,51 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
...
@@ -1971,6 +1971,51 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
test_05_CancelInventoryAfterDelivered
(
self
,
quiet
=
0
,
run
=
run_all_test
):
"""
Make sure that changing workflow state after delivered changes
records in stock table.
"""
delivered_state
=
self
.
portal
.
portal_workflow
.
inventory_workflow
.
states
[
'delivered'
]
delivered_state
.
transitions
=
delivered_state
.
transitions
+
(
'cancel'
,)
self
.
commit
()
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
)
product
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
)
inventory
=
self
.
portal
.
inventory_module
.
newContent
(
portal_type
=
'Inventory'
)
inventory
.
edit
(
destination_value
=
organisation
,
stop_date
=
DateTime
(
'2012/09/12 00:00:00 GMT+9'
))
line
=
inventory
.
newContent
(
portal_type
=
'Inventory Line'
)
line
.
setResourceValue
(
product
)
line
.
setQuantity
(
100
)
self
.
tic
()
self
.
assertEqual
(
self
.
portal
.
portal_simulation
.
getCurrentInventory
(
node_uid
=
organisation
.
getUid
(),
resource_uid
=
product
.
getUid
()),
0
)
inventory
.
deliver
()
self
.
tic
()
self
.
assertEqual
(
self
.
portal
.
portal_simulation
.
getCurrentInventory
(
node_uid
=
organisation
.
getUid
(),
resource_uid
=
product
.
getUid
()),
100
)
inventory
.
cancel
()
self
.
tic
()
self
.
assertEqual
(
self
.
portal
.
portal_simulation
.
getCurrentInventory
(
node_uid
=
organisation
.
getUid
(),
resource_uid
=
product
.
getUid
()),
0
)
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestInventory
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestInventory
))
...
...
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