[7.0 & trunk] [base] customization format_address

Bug #1122363 reported by Julio Serna-http://www.vauxoo.com on 2013-02-11
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP Publisher's Warranty Team

Bug Description

1.-Steps to reproduce the issue you have observed
to inherit new fields of address to res.partner
example: street3, street4, city2
to fill field format_address of res.country with fields of example
to create a new invoice
to choose customer

2.- The result you observed
send the follow error:
 File "/home/julio/Documentos/openerp/instancias/7.0/server-7.0/openerp/addons/base/res/res_partner.py", line 408, in name_get
    name = name + "\n" + self._display_address(cr, uid, record, without_company=True, context=context)
  File "/home/julio/Documentos/openerp/instancias/7.0/server-7.0/openerp/addons/base/res/res_partner.py", line 576, in _display_address
    return address_format % args
KeyError: u'street3'

This happens because there is not any function that allows me customize the fields that shows or return the function _display_address()

3.-The result you expected
it should have any function that allows customize the fields to show by the function _display_address() even when this fields have been inherited.

4.-
Ubuntu. 12.04, Python 2.7.2+
openerp- server : 4828

Related branches

description: updated
summary: - customization format_address
+ [7.0 & trunk] [base] customization format_address
Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance

Hi Julio,

You're right, there should be an easier way to include extra/custom fields in the display address format. It's always possible to override _display_address(), but it would be better to use a shared list of address fields.

Your merge proposal looks quite correct, however we are in the process of updating/reviewing several things related to address fields in the context of bug 1160365, so I'd like to fix everything in one go.

I've updated the current merge proposal for bug 1160365 to cover your case as well.

Could you double-check and see if that solves your problem?

Thanks for reporting and for providing a very good patch!

Changed in openobject-server:
importance: Undecided → Low
milestone: none → 7.0
status: New → Fix Committed

The fix for this issue was merged at the same time as the fix for bug 1160365. Thanks for reporting!

server 7.0: rev 4946 rev-id: <email address hidden>

Changed in openobject-server:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers