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
francois
erp5
Commits
9631f4fc
Commit
9631f4fc
authored
Aug 05, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove "quiet" from testInvoice
parent
119ee4a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
89 deletions
+46
-89
product/ERP5/tests/testInvoice.py
product/ERP5/tests/testInvoice.py
+46
-89
No files found.
product/ERP5/tests/testInvoice.py
View file @
9631f4fc
...
@@ -152,10 +152,10 @@ class TestInvoiceMixin(TestPackingListMixin):
...
@@ -152,10 +152,10 @@ class TestInvoiceMixin(TestPackingListMixin):
pass
# see createBusinessProcess
pass
# see createBusinessProcess
## XXX move this to "Sequence class"
## XXX move this to "Sequence class"
def
playSequence
(
self
,
sequence_string
,
quiet
=
0
)
:
def
playSequence
(
self
,
sequence_string
)
:
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
createBusinessProcess
(
self
):
def
createBusinessProcess
(
self
):
portal
=
self
.
portal
portal
=
self
.
portal
...
@@ -1131,7 +1131,6 @@ class TestInvoice(TestInvoiceMixin):
...
@@ -1131,7 +1131,6 @@ class TestInvoice(TestInvoiceMixin):
"""Test methods for sale and purchase invoice.
"""Test methods for sale and purchase invoice.
Subclasses must defines portal types to use.
Subclasses must defines portal types to use.
"""
"""
quiet
=
1
def
test_invoice_transaction_line_resource
(
self
):
def
test_invoice_transaction_line_resource
(
self
):
"""
"""
tests that simulation movements corresponding to accounting line have a
tests that simulation movements corresponding to accounting line have a
...
@@ -2311,11 +2310,10 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
...
@@ -2311,11 +2310,10 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
print
invoice
,
divergence_list
print
invoice
,
divergence_list
self
.
_solveDivergence
(
invoice
,
'quantity'
,
'Accept Solver'
)
self
.
_solveDivergence
(
invoice
,
'quantity'
,
'Accept Solver'
)
def
test_accept_quantity_divergence_on_invoice_with_stopped_packing_list
(
def
test_accept_quantity_divergence_on_invoice_with_stopped_packing_list
(
self
):
self
,
quiet
=
quiet
):
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence
=
sequence_list
.
addSequenceString
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
)
sequence
=
sequence_list
.
addSequenceString
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list_line
=
packing_list
.
getMovementList
()[
0
]
packing_list_line
=
packing_list
.
getMovementList
()[
0
]
...
@@ -2367,12 +2365,11 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
...
@@ -2367,12 +2365,11 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
print
invoice
,
divergence_list
print
invoice
,
divergence_list
self
.
_solveDivergence
(
invoice
,
'quantity'
,
'Adopt Solver'
)
self
.
_solveDivergence
(
invoice
,
'quantity'
,
'Adopt Solver'
)
def
test_adopt_quantity_divergence_on_invoice_line_with_stopped_packing_list
(
def
test_adopt_quantity_divergence_on_invoice_line_with_stopped_packing_list
(
self
):
self
,
quiet
=
quiet
):
# #1053
# #1053
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence
=
sequence_list
.
addSequenceString
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
)
sequence
=
sequence_list
.
addSequenceString
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list_line
=
packing_list
.
getMovementList
()[
0
]
packing_list_line
=
packing_list
.
getMovementList
()[
0
]
...
@@ -2452,7 +2449,6 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
...
@@ -2452,7 +2449,6 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
Those tests methods only work for sale, because sale and purchase invoice
Those tests methods only work for sale, because sale and purchase invoice
are not built at the same time on packing list workflow.
are not built at the same time on packing list workflow.
"""
"""
quiet
=
0
invoice_portal_type
=
'Sale Invoice Transaction'
invoice_portal_type
=
'Sale Invoice Transaction'
invoice_line_portal_type
=
'Invoice Line'
invoice_line_portal_type
=
'Invoice Line'
invoice_cell_portal_type
=
'Invoice Cell'
invoice_cell_portal_type
=
'Invoice Cell'
...
@@ -2566,7 +2562,6 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
...
@@ -2566,7 +2562,6 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
class
TestSaleInvoice
(
TestSaleInvoiceMixin
,
TestInvoice
,
ERP5TypeTestCase
):
class
TestSaleInvoice
(
TestSaleInvoiceMixin
,
TestInvoice
,
ERP5TypeTestCase
):
"""Tests for sale invoice.
"""Tests for sale invoice.
"""
"""
quiet
=
0
# fix inheritance
# fix inheritance
login
=
TestInvoiceMixin
.
login
login
=
TestInvoiceMixin
.
login
...
@@ -2578,12 +2573,10 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2578,12 +2573,10 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
getNeededCategoryList
=
TestInvoiceMixin
.
getNeededCategoryList
getNeededCategoryList
=
TestInvoiceMixin
.
getNeededCategoryList
def
test_
01_SimpleInvoice
(
self
,
quiet
=
quiet
):
def
test_
SimpleInvoice
(
self
):
"""
"""
Checks that a Simple Invoice is created from a Packing List
Checks that a Simple Invoice is created from a Packing List
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Simple Invoice'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -2601,9 +2594,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2601,9 +2594,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
stepCheckInvoiceLineHasReferenceAndIntIndex
stepCheckInvoiceLineHasReferenceAndIntIndex
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_
02_TwoInvoicesFromTwoPackingList
(
self
,
quiet
=
quiet
):
def
test_
TwoInvoicesFromTwoPackingList
(
self
):
"""
"""
This test was created for the following bug:
This test was created for the following bug:
- an order is created and confirmed
- an order is created and confirmed
...
@@ -2614,7 +2607,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2614,7 +2607,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
so we have an invoice with twice the number of accounting rules
so we have an invoice with twice the number of accounting rules
and an invoice with no accounting rules. both invoices are wrong
and an invoice with no accounting rules. both invoices are wrong
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Two Invoices from Two Packing List'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
TWO_PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
TWO_PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -2637,9 +2629,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2637,9 +2629,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckTwoInvoicesTransactionLines
stepCheckTwoInvoicesTransactionLines
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_03_InvoiceEditAndInvoiceRule
(
self
,
quiet
=
quiet
):
def
test_03_InvoiceEditAndInvoiceRule
(
self
):
"""
"""
Invoice Rule should not be applied on invoice lines created from
\
Invoice Rule should not be applied on invoice lines created from
\
Packing List.
Packing List.
...
@@ -2651,8 +2643,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2651,8 +2643,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
- A new Invoice Rule is created for this invoice, and accounting
- A new Invoice Rule is created for this invoice, and accounting
movements for this invoice are present twice in the simulation.
movements for this invoice are present twice in the simulation.
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Invoice Edit'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -2671,15 +2661,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2671,15 +2661,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckInvoiceRuleNotAppliedOnInvoiceEdit
stepCheckInvoiceRuleNotAppliedOnInvoiceEdit
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_04_PackingListEditAndInvoiceRule
(
self
,
quiet
=
quiet
):
def
test_04_PackingListEditAndInvoiceRule
(
self
):
"""
"""
Delivery Rule should not be applied on packing list lines created
\
Delivery Rule should not be applied on packing list lines created
\
from Order.
from Order.
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Packing List Edit'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -2689,15 +2677,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2689,15 +2677,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepTic
stepTic
stepCheckDeliveryRuleNotAppliedOnPackingListEdit
stepCheckDeliveryRuleNotAppliedOnPackingListEdit
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_05_InvoiceEditPackingListLine
(
self
,
quiet
=
quiet
):
def
test_05_InvoiceEditPackingListLine
(
self
):
"""
"""
Checks that editing a Packing List Line still creates a correct
Checks that editing a Packing List Line still creates a correct
Invoice
Invoice
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Packing List Line Edit'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -2715,15 +2701,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2715,15 +2701,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepRebuildAndCheckNothingIsCreated
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_06_InvoiceDeletePackingListLine
(
self
,
quiet
=
quiet
):
def
test_06_InvoiceDeletePackingListLine
(
self
):
"""
"""
Checks that deleting a Packing List Line still creates a correct
Checks that deleting a Packing List Line still creates a correct
Invoice
Invoice
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Packing List Line Delete'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_TWO_LINES_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_TWO_LINES_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -2742,15 +2726,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2742,15 +2726,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
stepTic
stepTic
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_07_InvoiceAddPackingListLine
(
self
,
quiet
=
quiet
):
def
test_07_InvoiceAddPackingListLine
(
self
):
"""
"""
Checks that adding a Packing List Line still creates a correct
Checks that adding a Packing List Line still creates a correct
Invoice
Invoice
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Packing List Line Add'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
self
.
PACKING_LIST_TWO_LINES_DEFAULT_SEQUENCE
)
:
self
.
PACKING_LIST_TWO_LINES_DEFAULT_SEQUENCE
)
:
...
@@ -2772,16 +2754,14 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2772,16 +2754,14 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepRebuildAndCheckNothingIsCreated
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_08_InvoiceDecreaseQuantity
(
self
,
quiet
=
quiet
):
def
test_08_InvoiceDecreaseQuantity
(
self
):
"""
"""
Change the quantity of a Invoice Line,
Change the quantity of a Invoice Line,
check that the invoice is divergent,
check that the invoice is divergent,
then split and defer, and check everything is solved
then split and defer, and check everything is solved
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Invoice Decrease Quantity'
)
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
"""
"""
stepSetReadyPackingList
stepSetReadyPackingList
...
@@ -2813,10 +2793,10 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2813,10 +2793,10 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepRebuildAndCheckNothingIsCreated
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
"""
self
.
playSequence
(
sequence
,
quiet
=
quiet
)
self
.
playSequence
(
sequence
)
@
newSimulationExpectedFailure
@
newSimulationExpectedFailure
def
test_09_InvoiceChangeStartDateFail
(
self
,
quiet
=
quiet
):
def
test_09_InvoiceChangeStartDateFail
(
self
):
"""
"""
Change the start_date of a Invoice Line,
Change the start_date of a Invoice Line,
check that the invoice is divergent,
check that the invoice is divergent,
...
@@ -2824,8 +2804,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2824,8 +2804,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
because Unify Solver does not propagage the change to the upper
because Unify Solver does not propagage the change to the upper
simulation movement.
simulation movement.
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Invoice Change Start Date'
)
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
"""
"""
stepSetReadyPackingList
stepSetReadyPackingList
...
@@ -2857,18 +2835,16 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2857,18 +2835,16 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepRebuildAndCheckNothingIsCreated
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
"""
self
.
playSequence
(
sequence
,
quiet
=
quiet
)
self
.
playSequence
(
sequence
)
@
newSimulationExpectedFailure
@
newSimulationExpectedFailure
def
test_09b_InvoiceChangeStartDateSucceed
(
self
,
quiet
=
quiet
):
def
test_09b_InvoiceChangeStartDateSucceed
(
self
):
"""
"""
Change the start_date of a Invoice Line,
Change the start_date of a Invoice Line,
check that the invoice is divergent,
check that the invoice is divergent,
deliver the Packing List to make sure it's frozen,
deliver the Packing List to make sure it's frozen,
then accept decision, and check everything is solved
then accept decision, and check everything is solved
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Invoice Change Sart Date'
)
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
"""
"""
stepSetReadyPackingList
stepSetReadyPackingList
...
@@ -2904,17 +2880,15 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2904,17 +2880,15 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepRebuildAndCheckNothingIsCreated
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
"""
self
.
playSequence
(
sequence
,
quiet
=
quiet
)
self
.
playSequence
(
sequence
)
def
test_10_AcceptDecisionOnPackingList
(
self
,
quiet
=
quiet
):
def
test_10_AcceptDecisionOnPackingList
(
self
):
"""
"""
- Increase or Decrease the quantity of a Packing List line
- Increase or Decrease the quantity of a Packing List line
- Accept Decision on Packing List
- Accept Decision on Packing List
- Packing List must not be divergent and use new quantity
- Packing List must not be divergent and use new quantity
- Invoice must not be divergent and use new quantity
- Invoice must not be divergent and use new quantity
"""
"""
if
not
quiet
:
self
.
logMessage
(
'InvoiceAcceptDecisionOnPackingList'
)
end_sequence
=
\
end_sequence
=
\
"""
"""
stepSetContainerFullQuantity
stepSetContainerFullQuantity
...
@@ -2971,9 +2945,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2971,9 +2945,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
seq
+
end_sequence
seq
+
end_sequence
sequence_list
.
addSequenceString
(
sequence
)
sequence_list
.
addSequenceString
(
sequence
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_16a_ManuallyAddedMovementsManyTransactions
(
self
,
quiet
=
quiet
):
def
test_16a_ManuallyAddedMovementsManyTransactions
(
self
):
"""
"""
Checks that adding invoice lines and accounting lines to one invoice
Checks that adding invoice lines and accounting lines to one invoice
generates correct simulation
generates correct simulation
...
@@ -2981,8 +2955,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2981,8 +2955,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
In this case checks what is happening, where movements are added in
In this case checks what is happening, where movements are added in
one transaction and edited in another
one transaction and edited in another
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Invoice with Manually Added Movements in separate transactions'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -3005,10 +2977,10 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3005,10 +2977,10 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepTic
stepTic
stepCheckSimulationTrees
stepCheckSimulationTrees
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_11_AcceptDecisionOnPackingListAndInvoice
(
self
,
quiet
=
quiet
):
def
test_11_AcceptDecisionOnPackingListAndInvoice
(
self
):
"""
"""
- Increase or Decrease the quantity of a Packing List line
- Increase or Decrease the quantity of a Packing List line
- Accept Decision on Packing List
- Accept Decision on Packing List
...
@@ -3018,8 +2990,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3018,8 +2990,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
- Packing List must not be divergent and use new quantity
- Packing List must not be divergent and use new quantity
- Invoice must not be divergent and use old quantity
- Invoice must not be divergent and use old quantity
"""
"""
if
not
quiet
:
self
.
logMessage
(
'InvoiceAcceptDecisionOnPackingListAndInvoice'
)
mid_sequence
=
\
mid_sequence
=
\
"""
"""
stepSetContainerFullQuantity
stepSetContainerFullQuantity
...
@@ -3092,9 +3062,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3092,9 +3062,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
seq1
+
mid_sequence
+
seq2
+
end_sequence
seq1
+
mid_sequence
+
seq2
+
end_sequence
sequence_list
.
addSequenceString
(
sequence
)
sequence_list
.
addSequenceString
(
sequence
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_12_SplitPackingListAndAcceptInvoice
(
self
,
quiet
=
quiet
):
def
test_12_SplitPackingListAndAcceptInvoice
(
self
):
"""
"""
- Decrease the quantity of a Packing List line
- Decrease the quantity of a Packing List line
- Split and Defer on Packing List
- Split and Defer on Packing List
...
@@ -3114,8 +3084,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3114,8 +3084,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
- Invoice1 must not be divergent and use old quantity
- Invoice1 must not be divergent and use old quantity
- Invoice2 must not be divergent and use 0 as quantity
- Invoice2 must not be divergent and use 0 as quantity
"""
"""
if
not
quiet
:
self
.
logMessage
(
'InvoiceSplitPackingListAndAcceptInvoice'
)
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
"""
"""
stepCheckInvoicingRule
stepCheckInvoicingRule
...
@@ -3208,9 +3176,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3208,9 +3176,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepRebuildAndCheckNothingIsCreated
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
"""
self
.
playSequence
(
sequence
,
quiet
=
quiet
)
self
.
playSequence
(
sequence
)
def
test_13_SplitAndDeferInvoice
(
self
,
quiet
=
quiet
):
def
test_13_SplitAndDeferInvoice
(
self
):
"""
"""
- Accept Order, Accept Packing List
- Accept Order, Accept Packing List
- Decrease quantity on Invoice
- Decrease quantity on Invoice
...
@@ -3221,8 +3189,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3221,8 +3189,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
- Invoice must not be divergent and use new quantity
- Invoice must not be divergent and use new quantity
- splitted Invoice must not be divergent and use old - new quantity
- splitted Invoice must not be divergent and use old - new quantity
"""
"""
if
not
quiet
:
self
.
logMessage
(
'InvoiceSplitAndDeferInvoice'
)
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
"""
"""
stepSetReadyPackingList
stepSetReadyPackingList
...
@@ -3279,9 +3245,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3279,9 +3245,9 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepRebuildAndCheckNothingIsCreated
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
"""
"""
self
.
playSequence
(
sequence
,
quiet
=
quiet
)
self
.
playSequence
(
sequence
)
def
test_14_AcceptDecisionOnInvoice
(
self
,
quiet
=
quiet
):
def
test_14_AcceptDecisionOnInvoice
(
self
):
"""
"""
- Accept Order, Accept Packing List
- Accept Order, Accept Packing List
- Increase or Decrease quantity on Invoice
- Increase or Decrease quantity on Invoice
...
@@ -3290,8 +3256,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3290,8 +3256,6 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
- Packing List must not be divergent and use old quantity
- Packing List must not be divergent and use old quantity
- Invoice must not be divergent and use new quantity
- Invoice must not be divergent and use new quantity
"""
"""
if
not
quiet
:
self
.
logMessage
(
'InvoiceAcceptDecisionOnInvoice'
)
mid_sequence
=
\
mid_sequence
=
\
"""
"""
stepSetReadyPackingList
stepSetReadyPackingList
...
@@ -3348,7 +3312,7 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3348,7 +3312,7 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
sequence
=
self
.
PACKING_LIST_DEFAULT_SEQUENCE
+
\
mid_sequence
+
seq
+
end_sequence
mid_sequence
+
seq
+
end_sequence
sequence_list
.
addSequenceString
(
sequence
)
sequence_list
.
addSequenceString
(
sequence
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_Reference
(
self
):
def
test_Reference
(
self
):
...
@@ -3372,13 +3336,11 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3372,13 +3336,11 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
self
.
assertEquals
(
'1'
,
invoice
.
getReference
())
self
.
assertEquals
(
'1'
,
invoice
.
getReference
())
def
test_16_ManuallyAddedMovements
(
self
,
quiet
=
quiet
):
def
test_16_ManuallyAddedMovements
(
self
):
"""
"""
Checks that adding invoice lines and accounting lines to one invoice
Checks that adding invoice lines and accounting lines to one invoice
generates correct simulation
generates correct simulation
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Invoice with Manually Added Movements'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -3400,15 +3362,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3400,15 +3362,13 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepTic
stepTic
stepCheckSimulationTrees
stepCheckSimulationTrees
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_17_ManuallyAddedWrongMovements
(
self
,
quiet
=
quiet
):
def
test_17_ManuallyAddedWrongMovements
(
self
):
"""
"""
Checks that adding invoice lines and accounting lines to one invoice
Checks that adding invoice lines and accounting lines to one invoice
generates correct simulation, even when adding very wrong movements
generates correct simulation, even when adding very wrong movements
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Invoice with Manually Added Movements'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -3428,14 +3388,12 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3428,14 +3388,12 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckStartInvoiceFail
stepCheckStartInvoiceFail
stepCheckSimulationTrees
stepCheckSimulationTrees
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
test_18_compareInvoiceAndPackingList
(
self
,
quiet
=
quiet
):
def
test_18_compareInvoiceAndPackingList
(
self
):
"""
"""
Checks that a Simple Invoice is created from a Packing List
Checks that a Simple Invoice is created from a Packing List
"""
"""
if
not
quiet
:
self
.
logMessage
(
'Simple Invoice'
)
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
for
base_sequence
in
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
,
)
:
sequence_list
.
addSequenceString
(
sequence_list
.
addSequenceString
(
...
@@ -3452,7 +3410,7 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3452,7 +3410,7 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
stepCheckInvoicesConsistency
stepCheckInvoicesConsistency
stepCheckPackingListInvoice
stepCheckPackingListInvoice
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
def
_adoptDivergenceOnPackingList
(
self
,
packing_list
,
divergence_list
):
def
_adoptDivergenceOnPackingList
(
self
,
packing_list
,
divergence_list
):
builder_list
=
packing_list
.
getBuilderList
()
builder_list
=
packing_list
.
getBuilderList
()
...
@@ -3460,13 +3418,12 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -3460,13 +3418,12 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
builder
.
solveDivergence
(
packing_list
.
getRelativeUrl
(),
builder
.
solveDivergence
(
packing_list
.
getRelativeUrl
(),
divergence_to_adopt_list
=
divergence_list
)
divergence_to_adopt_list
=
divergence_list
)
def
test_accept_quantity_divergence_on_invoice_with_started_packing_list
(
def
test_accept_quantity_divergence_on_invoice_with_started_packing_list
(
self
):
self
,
quiet
=
quiet
):
# only applies to sale invoice, because purchase invoices are not built yet
# only applies to sale invoice, because purchase invoices are not built yet
# when the packing list is in started state
# when the packing list is in started state
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence
=
sequence_list
.
addSequenceString
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
)
sequence
=
sequence_list
.
addSequenceString
(
self
.
PACKING_LIST_DEFAULT_SEQUENCE
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
)
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list
=
sequence
.
get
(
'packing_list'
)
packing_list_line
=
packing_list
.
getMovementList
()[
0
]
packing_list_line
=
packing_list
.
getMovementList
()[
0
]
...
...
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