Commit 0564a7a8 authored by Vincent Pelletier's avatar Vincent Pelletier

Split createBankAccount into 2 methods:

- one creating a bank account
- one providing an inventory for that bank account


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29110 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ae842db7
......@@ -850,9 +850,12 @@ class TestERP5BankingMixin:
# validate this bank account for payment
bank_account.validate()
if amount == 0:
return 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 @@ class TestERP5BankingMixin:
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 @@ class TestERP5BankingMixin:
inventory.deliver()
self.account_inventory_number += 1
return bank_account
def createCheckbook(self, id, vault, bank_account, min, max, date=None):
"""
......
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