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
Kasra Jamshidi
erp5
Commits
31586510
Commit
31586510
authored
Mar 10, 2016
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testItem: test expected behaviour of item tracking with transit movement
parent
d561dd5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
product/ERP5/tests/testItem.py
product/ERP5/tests/testItem.py
+50
-0
No files found.
product/ERP5/tests/testItem.py
View file @
31586510
...
...
@@ -1094,6 +1094,56 @@ class TestItemScripts(ERP5TypeTestCase):
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteTitle
(
at_date
=
DateTime
()
-
2
))
def
test_item_current_location_and_transit_movement
(
self
):
# a started packing list is still in transit, so we do not know its
# current location until it is delivered.
# https://lab.nexedi.com/nexedi/erp5/merge_requests/70
implicit_movement
=
self
.
portal
.
implicit_item_movement_module
.
newContent
(
portal_type
=
'Implicit Item Movement'
,
destination_value
=
self
.
mirror_node
,
destination_section_value
=
self
.
mirror_section
,
stop_date
=
DateTime
()
-
2
,
aggregate_value
=
self
.
item
,
)
implicit_movement
.
deliver
()
packing_list
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
,
source_value
=
self
.
mirror_node
,
source_section_value
=
self
.
mirror_section
,
destination_value
=
self
.
node
,
destination_section_value
=
self
.
section
,
specialise_value
=
self
.
portal
.
business_process_module
.
erp5_default_business_process
,
start_date
=
DateTime
()
-
1
,)
line
=
packing_list
.
newContent
(
portal_type
=
'Sale Packing List Line'
,
quantity
=
1
,
resource_value
=
self
.
product
,
aggregate_value
=
self
.
item
,)
packing_list
.
confirm
()
self
.
tic
()
self
.
assertEqual
(
self
.
mirror_node
,
self
.
item
.
Item_getCurrentSiteValue
())
self
.
assertEqual
(
'Mirror Node'
,
self
.
item
.
Item_getCurrentSiteTitle
())
self
.
assertEqual
(
self
.
mirror_section
,
self
.
item
.
Item_getCurrentOwnerValue
())
self
.
assertEqual
(
'Mirror Section'
,
self
.
item
.
Item_getCurrentOwnerTitle
())
packing_list
.
start
()
self
.
tic
()
# When movement is started, the item is still moving so we do not know it's location / ownership.
# In this case we just return None.
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteValue
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentSiteTitle
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentOwnerValue
())
self
.
assertEqual
(
None
,
self
.
item
.
Item_getCurrentOwnerTitle
())
packing_list
.
stop
()
self
.
tic
()
self
.
assertEqual
(
self
.
node
,
self
.
item
.
Item_getCurrentSiteValue
())
self
.
assertEqual
(
'Node'
,
self
.
item
.
Item_getCurrentSiteTitle
())
self
.
assertEqual
(
self
.
section
,
self
.
item
.
Item_getCurrentOwnerValue
())
self
.
assertEqual
(
'Section'
,
self
.
item
.
Item_getCurrentOwnerTitle
())
# with cells
@
reindex
def
_makeSalePackingListCellWithVariation
(
self
):
...
...
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