Address Localization

Registered by pheller on 2009-03-10

In the United States, addresses are normal written "City, State ZIP Code"; whereas, in Europe, they are often written "ZIP Code City, State". (In both cases, Country is normal written last).

I propose that functionality be added to allow forms to be re-rendered in the format of the OpenERP user's locale, and that reports are re-rendered such that each individual address is shown in it's native locale.

I.e., a US Company selling to a German company would display the ship from in the format of "City, State ZIP Code", where as the ship to would display in the format "ZIP Code City, State"

Blueprint information

Status:
Started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
pheller
Definition:
Discussion
Series goal:
None
Implementation:
Good progress
Milestone target:
None
Started by
pheller on 2010-05-07

Whiteboard

NOTE: When editing this whiteboard, please append your text, and date stamp it.

7 MAY 2010 - 1700 GMT-4

I've chosen to store the address localization within res.country, and a functional field within res.partner.address which returns the formatted address, by evaluating the formatting stored within the associated res.country object.

The result is that you may now place the localized address in an rml file with a tag like so:

<para style="terp_default_9">[[ o.partner_shipping_id.formatted_address ]]</para>

Rather than the current:

<para style="terp_default_9">[[ o.partner_shipping_id.street ]]</para>
<para style="terp_default_9">[[ o.partner_shipping_id.street2 or '' ]]</para>
<para style="terp_default_9">[[ o.partner_shipping_id.zip or '' ]] [[ o.partner_shipping_id.city or '' ]]</para>
<para style="terp_default_9">[[ o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name or '' ]] [[ o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '' ]]</para>

Yet to be done is to make the rml header conform to this, and to then update all the rml files.

Please pull the branch down, update an rml file or two, as I've outlined above, and let me know if it works for you.

7 MAY 2010 - 1900 GMT-4

Also, there is a lot of address format information here:
http://www.columbia.edu/kermit/postal.html
http://www.bitboost.com/ref/international-address-formats.html#Formats
http://en.wikipedia.org/wiki/Address_(geography)#Mailing_address_format_by_country

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.