[Erp5-report] r13452 - /erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 16 12:38:54 CET 2007


Author: vincent
Date: Fri Mar 16 12:38:50 2007
New Revision: 13452

URL: http://svn.erp5.org?rev=13452&view=rev
Log:
Generate automatically reference number if after ank account creation it is still None.

Modified:
    erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py

Modified: erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py?rev=13452&r1=13451&r2=13452&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py (original)
+++ erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py Fri Mar 16 12:38:50 2007
@@ -681,6 +681,15 @@
                                      portal_type = 'Bank Account',
                                      price_currency_value = currency,
                                      **kw)
+    if not kw.has_key('reference') and bank_account.getReference() is None:
+      # If there is no automatic getter-time calculation of the reference and
+      # no reference has been explicitely set, generate one composed of all
+      # bank codes and a static prefix - to avoid collisions as much as
+      # possible.
+      bank_account.edit(reference='ref_%s%s%s%s%s' % (kw['bank_country_code'],
+        kw['bank_code'], kw['branch'], kw['bank_account_number'],
+        kw['bank_account_key']))
+      
     # validate this bank account for payment
     bank_account.validate()
     if amount == 0:




More information about the Erp5-report mailing list