← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~therp-nl/banking-addons/6.1_lp1176783 into lp:banking-addons

 

Holger Brunn (Therp) has proposed merging lp:~therp-nl/banking-addons/6.1_lp1176783 into lp:banking-addons.

Requested reviews:
  Banking Addons Team (banking-addons-team)
Related bugs:
  Bug #1176783 in Banking Addons: "KeyError: none on transaction import"
  https://bugs.launchpad.net/banking-addons/+bug/1176783

For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/6.1_lp1176783/+merge/162566
-- 
https://code.launchpad.net/~therp-nl/banking-addons/6.1_lp1176783/+merge/162566
Your team Banking Addons Team is requested to review the proposed merge of lp:~therp-nl/banking-addons/6.1_lp1176783 into lp:banking-addons.
=== modified file 'account_banking/banking_import_transaction.py'
--- account_banking/banking_import_transaction.py	2013-04-26 08:27:33 +0000
+++ account_banking/banking_import_transaction.py	2013-05-06 07:43:28 +0000
@@ -1048,6 +1048,7 @@
                         break
                 else:
                     retval['match_type'] = 'invoice'
+                retval['type'] = type_map[move_line.invoice.type]
             else:
                 if retval['match_type']: 
                     retval['match_type'] = False
@@ -1057,8 +1058,8 @@
         if move_lines and len(move_lines) == 1:
             retval['reference'] = move_lines[0].ref
         if retval['match_type'] == 'invoice':
-            retval['invoice_ids'] = list(set([x.invoice.id for x in move_lines]))
-            retval['type'] = type_map[move_lines[0].invoice.type]
+            retval['invoice_ids'] = list(set(
+                [x.invoice.id for x in move_lines if x.invoice]))
         return retval
     
     def match(self, cr, uid, ids, results=None, context=None):


Follow ups