Commit 07ef84cf authored by Vincent Pelletier's avatar Vincent Pelletier

Generate automatically reference number if after ank account creation it is still None.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13452 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c2986947
......@@ -681,6 +681,15 @@ class TestERP5BankingMixin:
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:
......
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