Odoo Help


Show Partner's Full Address in Treeview

on 2/2/16, 1:15 PM 1,487 views

Wondering if this is possible. I am specifically trying to do it with the customers shipping address in the Invoices Treeview.

I got it to work in formview like this: 

<field name="address_shipping_id" position="attributes" context="{'show_address': 1, 'default_type': 'delivery'}" options="{'always_reload': True}"/>

But I think it should be different in treeview to get this to work.

Thank you in advance for your time.

--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 2/3/16, 3:57 AM


 There may be a solution by adding a new functional field e.g:

'shipping_address': fields.function(_get_shipping_address, string='Shipping Address', type='char'),

Then the function could be such as:

 def _get_shipping_address(self, cr, uid, ids, name, arg, context=None):
res = {}
partner = self.pool['res.partner'] #if you're using the res.partner for address
for rec in self.browse(cr, uid, ids, context=context):
            ship_id = rec.address_shipping_id
            address = ship_id and partner.name_get(cr, uid, [ship_id.id], context={'show_address': 1}                )[0][1] or ''
            res[rec.id] = address
return res

Then add this new field in the tree view instead of address_shipping_id

This is an idea there may be a better one. and you can refine it ...


Thanks for the suggestion, I'll give that a try.

on 2/3/16, 9:00 AM

Works great. Thank you for your time, my friend.

on 2/3/16, 10:14 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/2/16, 1:15 PM
Seen: 1487 times
Last updated: 2/3/16, 10:12 AM