From de2a7a211ac9f8edcbe5199ea187d720f73485cc Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 26 May 2015 13:18:49 +0200 Subject: [PATCH] [FIX] account_followup: invoice address On the follow up report, the address used in the report must be the address of the responsible partner. opw:639907 --- addons/account_followup/views/report_followup.xml | 2 +- addons/account_followup/wizard/account_followup_print.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/account_followup/views/report_followup.xml b/addons/account_followup/views/report_followup.xml index 98f1e7be510..622b65ee754 100644 --- a/addons/account_followup/views/report_followup.xml +++ b/addons/account_followup/views/report_followup.xml @@ -9,7 +9,7 @@
-
diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index e72ebdc448f..3c28e8b5ead 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -31,6 +31,13 @@ class account_followup_stat_by_partner(osv.osv): _description = "Follow-up Statistics by Partner" _rec_name = 'partner_id' _auto = False + + def _get_invoice_partner_id(self, cr, uid, ids, field_name, arg, context=None): + result = {} + for rec in self.browse(cr, uid, ids, context=context): + result[rec.id] = rec.partner_id.address_get(adr_pref=['invoice']).get('invoice', rec.partner_id.id) + return result + _columns = { 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), 'date_move':fields.date('First move', readonly=True), @@ -40,6 +47,7 @@ class account_followup_stat_by_partner(osv.osv): 'Max Follow Up Level', readonly=True, ondelete="cascade"), 'balance':fields.float('Balance', readonly=True), 'company_id': fields.many2one('res.company', 'Company', readonly=True), + 'invoice_partner_id': fields.function(_get_invoice_partner_id, type='many2one', relation='res.partner', string='Invoice Address') } _depends = {