[Erp5-report] r23084 - /erp5/trunk/products/ERP5/tests/testAccounting.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Aug 21 16:06:27 CEST 2008
Author: jerome
Date: Thu Aug 21 16:06:27 2008
New Revision: 23084
URL: http://svn.erp5.org?rev=23084&view=rev
Log:
reset the grouping reference when cancelling a transaction
Modified:
erp5/trunk/products/ERP5/tests/testAccounting.py
Modified: erp5/trunk/products/ERP5/tests/testAccounting.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccounting.py?rev=23084&r1=23083&r2=23084&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Thu Aug 21 16:06:27 2008
@@ -2179,6 +2179,43 @@
invoice.stop()
self.failIf(invoice_line.getGroupingReference())
self.failIf(payment_line.getGroupingReference())
+
+ def test_automatically_unsetting_grouping_reference_when_cancelling(self):
+ invoice = self._makeOne(
+ title='First Invoice',
+ destination_section_value=self.organisation_module.client_1,
+ lines=(dict(source_value=self.account_module.goods_purchase,
+ source_debit=100),
+ dict(source_value=self.account_module.receivable,
+ source_credit=100,
+ id='line_for_grouping_reference',)))
+ invoice_line = invoice.line_for_grouping_reference
+
+ payment = self._makeOne(
+ title='First Invoice Payment',
+ portal_type='Payment Transaction',
+ simulation_state='delivered',
+ causality_value=invoice,
+ source_payment_value=self.section.newContent(
+ portal_type='Bank Account'),
+ destination_section_value=self.organisation_module.client_1,
+ lines=(dict(source_value=self.account_module.receivable,
+ id='line_for_grouping_reference',
+ source_debit=100),
+ dict(source_value=self.account_module.bank,
+ source_credit=100,)))
+ payment_line = payment.line_for_grouping_reference
+
+ invoice.stop()
+ self.failUnless(invoice_line.getGroupingReference())
+ self.failUnless(payment_line.getGroupingReference())
+
+ invoice.cancel()
+ get_transaction().commit()
+ self.tic()
+ self.failIf(invoice_line.getGroupingReference())
+ self.failIf(payment_line.getGroupingReference())
+
class TestAccountingWithSequences(ERP5TypeTestCase):
More information about the Erp5-report
mailing list