Commit bd1b9df9 authored by Łukasz Nowak's avatar Łukasz Nowak

- check case of Invoice Rule expand method, when invoice is related to...

 - check case of Invoice Rule expand method, when invoice is related to packing list and movements are added in separate transactions - first add, tic, then modify


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26996 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa6fdeca
...@@ -2121,6 +2121,24 @@ class TestSaleInvoiceMixin(TestInvoiceMixin, ...@@ -2121,6 +2121,24 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
self.assertEquals(self.default_quantity + last_delta, self.assertEquals(self.default_quantity + last_delta,
line.getQuantity()) line.getQuantity())
def stepAddInvoiceLinesManyTransactions(self, sequence=None, sequence_list=[]):
"""
add some invoice and accounting lines to the invoice
"""
invoice = sequence.get('invoice')
invoice_line = invoice.newContent(portal_type='Invoice Line')
transaction_line_1 = invoice.newContent(portal_type='Sale Invoice Transaction Line')
transaction_line_2 = invoice.newContent(portal_type='Sale Invoice Transaction Line')
transaction.commit()
self.tic()
invoice_line.edit(resource_value=sequence.get('resource'), quantity=3,
price=555)
transaction_line_1.edit(id ='receivable', source='account_module/customer',
destination='account_module/supplier', quantity=-1665)
transaction_line_2.edit(
id='income', source='account_module/sale',
destination='account_module/purchase', quantity=1665)
def stepAddInvoiceLines(self, sequence=None, sequence_list=[]): def stepAddInvoiceLines(self, sequence=None, sequence_list=[]):
""" """
add some invoice and accounting lines to the invoice add some invoice and accounting lines to the invoice
...@@ -3041,6 +3059,38 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase): ...@@ -3041,6 +3059,38 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
""") """)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def test_16a_ManuallyAddedMovementsManyTransactions(self, quiet=quiet):
"""
Checks that adding invoice lines and accounting lines to one invoice
generates correct simulation
In this case checks what is happening, where movements are added in
one transaction and edited in another
"""
if not quiet:
self.logMessage('Invoice with Manually Added Movements in separate transactions')
sequence_list = SequenceList()
for base_sequence in (self.PACKING_LIST_DEFAULT_SEQUENCE, ) :
sequence_list.addSequenceString(
base_sequence +
"""
stepSetReadyPackingList
stepTic
stepStartPackingList
stepCheckInvoicingRule
stepTic
stepCheckInvoiceBuilding
stepRebuildAndCheckNothingIsCreated
stepCheckInvoicesConsistency
stepAddInvoiceLinesManyTransactions
stepTic
stepCheckInvoiceIsSolved
stepStartInvoice
stepTic
stepCheckSimulationTrees
""")
sequence_list.play(self, quiet=quiet)
def test_17_ManuallyAddedWrongMovements(self, quiet=quiet, run=RUN_ALL_TESTS): def test_17_ManuallyAddedWrongMovements(self, quiet=quiet, run=RUN_ALL_TESTS):
""" """
Checks that adding invoice lines and accounting lines to one invoice Checks that adding invoice lines and accounting lines to one invoice
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment