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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Sep 18 17:45:40 CEST 2009


Author: vincent
Date: Fri Sep 18 17:45:36 2009
New Revision: 29110

URL: http://svn.erp5.org?rev=29110&view=rev
Log:
Split createBankAccount into 2 methods:
- one creating a bank account
- one providing an inventory for that bank account

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=29110&r1=29109&r2=29110&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py [utf8] (original)
+++ erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py [utf8] Fri Sep 18 17:45:36 2009
@@ -850,9 +850,12 @@
       
     # validate this bank account for payment
     bank_account.validate()
-    if amount == 0:
-      return bank_account
-    # we need to put some money on this bank account
+    if amount:
+      # we need to put some money on this bank account
+      self.createBankAccountInventory(bank_account, amount, inv_date=inv_date)
+    return bank_account
+
+  def createBankAccountInventory(self, bank_account, amount, inv_date=None):
     if not hasattr(self, 'bank_account_inventory'):
       self.bank_account_inventory = self.bank_account_inventory_module.newContent(id='account_inventory_group',
                                                                                 portal_type='Bank Account Inventory Group',
@@ -868,7 +871,7 @@
     account_inventory_line_id = 'account_inventory_line_%s' %(self.account_inventory_number,)
     inventory_line = inventory.newContent(id=account_inventory_line_id,
                                           portal_type='Bank Account Inventory Line',
-                                          resource_value=currency,
+                                          resource_value=bank_account.getPriceCurrencyValue(),
                                           quantity=amount)
 
 
@@ -877,8 +880,6 @@
       inventory.deliver()
 
     self.account_inventory_number += 1
-    return bank_account
-
 
   def createCheckbook(self, id, vault, bank_account, min, max, date=None):
     """




More information about the Erp5-report mailing list