[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:
parent
0ff26cf7cd
commit
de2a7a211a
|
@ -9,7 +9,7 @@
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-5 col-xs-offset-7">
|
<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}'/>
|
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
|
||||||
<span t-field="o.partner_id.vat"/>
|
<span t-field="o.partner_id.vat"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,6 +31,13 @@ class account_followup_stat_by_partner(osv.osv):
|
||||||
_description = "Follow-up Statistics by Partner"
|
_description = "Follow-up Statistics by Partner"
|
||||||
_rec_name = 'partner_id'
|
_rec_name = 'partner_id'
|
||||||
_auto = False
|
_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 = {
|
_columns = {
|
||||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
||||||
'date_move':fields.date('First move', 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"),
|
'Max Follow Up Level', readonly=True, ondelete="cascade"),
|
||||||
'balance':fields.float('Balance', readonly=True),
|
'balance':fields.float('Balance', readonly=True),
|
||||||
'company_id': fields.many2one('res.company', 'Company', 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 = {
|
_depends = {
|
||||||
|
|
Loading…
Reference in New Issue