← Back to team overview

banking-addons-team team mailing list archive

lp:~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881 into lp:banking-addons/bank-statement-reconcile-70

 

Yannick Vaucher @ Camptocamp has proposed merging lp:~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881 into lp:banking-addons/bank-statement-reconcile-70.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)
Related bugs:
  Bug #1194881 in Banking Addons: "[7.0] account_statement_base_completion - completion on invoice number takes wrong partner"
  https://bugs.launchpad.net/banking-addons/+bug/1194881

For more details, see:
https://code.launchpad.net/~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881/+merge/171560
-- 
https://code.launchpad.net/~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881/+merge/171560
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881 into lp:banking-addons/bank-statement-reconcile-70.
=== modified file 'account_statement_base_completion/statement.py'
--- account_statement_base_completion/statement.py	2013-04-30 09:51:39 +0000
+++ account_statement_base_completion/statement.py	2013-06-26 13:50:53 +0000
@@ -178,7 +178,15 @@
         res = {}
         inv = self._find_invoice(cr, uid, line, inv_type, context=context)
         if inv:
-            res = {'partner_id': inv.partner_id.id,
+            # FIXME use only commercial_partner_id of invoice in 7.1
+            # this is for backward compatibility in 7.0 before 
+            # the refactoring of res.partner
+            if hasattr(inv, 'commercial_partner_id'):
+                partner_id = inv.commercial_partner_id.id
+            else:
+                partner_id = inv.partner_id.id
+
+            res = {'partner_id': partner_id,
                    'account_id': inv.account_id.id,
                    'type': inv_type}
             override_acc = line['master_account_id']


Follow ups