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
Łukasz Nowak
erp5
Commits
d2f4dd44
Commit
d2f4dd44
authored
May 17, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testInvoice: add merge invoice test
parent
f7833a14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
product/ERP5/tests/testInvoice.py
product/ERP5/tests/testInvoice.py
+57
-0
No files found.
product/ERP5/tests/testInvoice.py
View file @
d2f4dd44
...
...
@@ -2471,6 +2471,63 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
self
.
assertEqual
([],
packing_list
.
getDivergenceList
())
self
.
assertEqual
(
'solved'
,
packing_list
.
getCausalityState
())
def
test_merge_accounting_invoice
(
self
,
quiet
=
quiet
):
sequence_list
=
SequenceList
()
sequence
=
sequence_list
.
addSequenceString
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list_line
=
packing_list
.
getMovementList
()[
0
]
quantity
=
packing_list_line
.
getQuantity
()
resource
=
packing_list_line
.
getResource
()
price
=
packing_list_line
.
getPrice
()
packing_list
.
setReady
()
packing_list
.
start
()
packing_list
.
stop
()
self
.
tic
()
self
.
default_quantity
=
self
.
default_quantity
+
10
self
.
default_price
=
self
.
default_price
+
10
self
.
tic
()
sequence_list
.
play
(
self
,
quiet
=
quiet
)
packing_list_2
=
sequence
.
get
(
'packing_list'
)
packing_list_line
=
packing_list_2
.
getMovementList
()[
0
]
quantity_2
=
packing_list_line
.
getQuantity
()
resource_2
=
packing_list_line
.
getResource
()
price_2
=
packing_list_line
.
getPrice
()
packing_list_2
.
setReady
()
packing_list_2
.
start
()
packing_list_2
.
stop
()
self
.
tic
()
self
.
stepInvoiceBuilderAlarm
()
self
.
tic
()
self
.
default_quantity
=
self
.
default_quantity
-
10
self
.
default_price
=
self
.
default_price
-
10
invoice
=
packing_list
.
getCausalityRelatedValue
(
portal_type
=
self
.
invoice_portal_type
)
invoice_2
=
packing_list_2
.
getCausalityRelatedValue
(
portal_type
=
self
.
invoice_portal_type
)
self
.
assertNotEquals
(
invoice
,
None
)
self
.
assertNotEquals
(
invoice_2
,
None
)
self
.
tic
()
error_list
=
self
.
portal
.
portal_simulation
.
mergeDeliveryList
([
invoice
,
invoice_2
])
self
.
tic
()
self
.
assertEqual
(
0
,
len
(
error_list
))
self
.
assertEqual
(
invoice
.
getSimulationState
(),
'confirmed'
)
# MergeDeliveryList change the first delivery to diverged
# Make sure it works as expected
self
.
assertEqual
(
invoice
.
getCausalityState
(),
'diverged'
)
self
.
assertEqual
(
invoice_2
.
getSimulationState
(),
'cancelled'
)
self
.
assertEqual
(
len
(
invoice
.
getMovementList
()),
2
)
expected_set
=
set
([
(
resource
,
quantity
,
price
),
(
resource_2
,
quantity_2
,
price_2
)])
result_set
=
set
(
sorted
(
[(
x
.
getResource
(),
x
.
getQuantity
(),
x
.
getPrice
())
for
x
in
invoice
.
getMovementList
()],
key
=
lambda
x
:
x
[
1
]))
self
.
assertEqual
(
expected_set
,
result_set
)
def
test_subcontent_reindexing
(
self
):
"""Tests, that modification on Order are propagated to lines and cells
...
...
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