From 146331f10c9e8c03af664a0bfbd3f810e95287a1 Mon Sep 17 00:00:00 2001 From: Matthieu Dietrich Date: Mon, 11 Aug 2014 12:47:27 +0200 Subject: [PATCH] [FIX] correct partner used in statement import for refunds --- account_statement_transactionid_completion/statement.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/account_statement_transactionid_completion/statement.py b/account_statement_transactionid_completion/statement.py index 8fcb13d2..fbe65e8d 100644 --- a/account_statement_transactionid_completion/statement.py +++ b/account_statement_transactionid_completion/statement.py @@ -110,7 +110,13 @@ class AccountStatementCompletionRule(Model): elif len(invoice_id) == 1: invoice = invoice_obj.browse(cr, uid, invoice_id[0], context=context) - res['partner_id'] = invoice.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(invoice, 'commercial_partner_id'): + res['partner_id'] = invoice.commercial_partner_id.id + else: + res['partner_id'] = invoice.partner_id.id # we want the move to have the same ref than the found # invoice's move, thus it will be easier to link them for the # accountants