[FIX] base_address_extended: Wrong street format

Steps to reproduce the bug:

- Create a german contact C with street1 = 'Istanbulstraße 22-26'
- Install base_address_extended
- Go to C and edit it

Bug:

'Istanbulstraße' was  displayed in the number of the street

PS: A post init hook is needed otherwise the default street_format
'%(street_number)s/%(street_number2)s %(street_name)s' was always used.

opw:2320385

closes odoo/odoo#58905

X-original-commit: a97d981b9dd96b0066e09d763eff10a6ca70819c
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2020-09-30 16:40:59 +00:00
parent 8999b3a37b
commit 825dcb242b
3 changed files with 10 additions and 0 deletions
+6
View File
@@ -2,3 +2,9 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from odoo import api, SUPERUSER_ID
def _update_street_format(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
env['res.partner'].search([])._compute_street_data()
@@ -20,4 +20,5 @@ with the street name, the house number, and room number.
'data/base_address_extended_data.xml',
],
'depends': ['base'],
'post_init_hook': '_update_street_format',
}
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="base.de" model="res.country">
<field eval="'%(street_name)s %(street_number)s/%(street_number2)s'" name="street_format" />
</record>
<record id="base.nl" model="res.country">
<field eval="'%(street_name)s %(street_number)s/%(street_number2)s'" name="street_format" />
</record>