[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
This commit is contained in:
Goffin Simon 2015-05-26 13:18:49 +02:00
parent 0ff26cf7cd
commit de2a7a211a
2 changed files with 9 additions and 1 deletions

View File

@ -9,7 +9,7 @@
<div class="page">
<div class="row">
<div class="col-xs-5 col-xs-offset-7">
<div t-field="o.partner_id"
<div t-field="o.invoice_partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<span t-field="o.partner_id.vat"/>
</div>

View File

@ -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 = {