← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~therp-nl/banking-addons/6.1-dev-fix_code_and_state into lp:~banking-addons-team/banking-addons/6.1-dev

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/banking-addons/6.1-dev-fix_code_and_state into lp:~banking-addons-team/banking-addons/6.1-dev.

Requested reviews:
  James Jesudason (jamesj)

For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/6.1-dev-fix_code_and_state/+merge/96539

This branch solves two errors when testing 6.1-dev rev. 119:

- "Invalid field 'code' in domain expression ['&', ('active', '=', 1), ('code', 'ilike', 'UNKNOW')]" when creating a new bank from an on line account number lookup.
- "Unknown field state in domain [["state","not in",["draft"]]]" when a statement line is clicked in the bank statement form

-- 
https://code.launchpad.net/~therp-nl/banking-addons/6.1-dev-fix_code_and_state/+merge/96539
Your team Banking Addons Team is subscribed to branch lp:~banking-addons-team/banking-addons/6.1-dev.
=== modified file 'account_banking/account_banking.py'
--- account_banking/account_banking.py	2012-03-07 23:02:52 +0000
+++ account_banking/account_banking.py	2012-03-08 10:37:26 +0000
@@ -1457,7 +1457,6 @@
                 # Only the first eight positions of BIC are used for bank
                 # transfers, so ditch the rest.
                 bic = info.bic[:8],
-                code = info.code,
                 street = address.street,
                 street2 = 
                     address.has_key('street2') and address.street2 or False,

=== modified file 'account_banking/account_banking_view.xml'
--- account_banking/account_banking_view.xml	2012-02-19 21:10:20 +0000
+++ account_banking/account_banking_view.xml	2012-03-08 10:37:26 +0000
@@ -297,6 +297,7 @@
                         <field name="reconcile_id"/>
                     </xpath>
                     <xpath expr="/form/notebook/page/field[@name='line_ids']/form/field[@name='amount']" position="after">
+                        <field name="state"/>
                         <field name="invoice_id"/>
                         <field name="reconcile_id"/>
                     </xpath>

=== modified file 'account_banking/wizard/banktools.py'
--- account_banking/wizard/banktools.py	2012-02-21 23:50:13 +0000
+++ account_banking/wizard/banktools.py	2012-03-08 10:37:26 +0000
@@ -374,35 +374,6 @@
     if bic:
         values.bank = get_or_create_bank(pool, cursor, uid, bic)[0]
 
-    else:
-        if not bankcode:
-            bankcode = "UNKNOW"
-        # Try to link bank
-        bank_obj = pool.get('res.bank')
-        bank_ids = bank_obj.search(cursor, uid, [
-            ('code', 'ilike', bankcode)
-        ])
-        if bank_ids:
-            # Check BIC on existing banks
-            values.bank = bank_ids[0]
-            bank = bank_obj.browse(cursor, uid, values.bank)
-            if not bank.bic:
-                bank_obj.write(cursor, uid, values.bank, dict(bic=bic))
-        else:
-            # New bank - create
-            res = struct(country_id=country_id)
-            if account_info:
-                res.code = account_info.code
-                # Only the first eight positions of BIC are used for bank
-                # transfers, so ditch the rest.
-                res.bic = account_info.bic[:8]
-                res.name = account_info.bank
-            else:
-                res.code = bankcode
-                res.name = _('Unknown Bank')
-
-            values.bank = bank_obj.create(cursor, uid, res)
-
     # Create bank account and return
     return pool.get('res.partner.bank').create(cursor, uid, values)
 


Follow ups