diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 061344b9ae3..c5da0974dc0 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -67,10 +67,12 @@ class format_address(object): doc = etree.fromstring(arch) for node in doc.xpath("//div[@class='address_format']"): tree = etree.fromstring(v % {'city': _('City'), 'zip': _('ZIP'), 'state': _('State')}) - for child in node.xpath("//field"): - if child.attrib.get('modifiers'): - for field in tree.xpath("//field[@name='%s']" % child.attrib.get('name')): + for child in node.xpath(".//field"): + for field in tree.xpath("//field[@name='%s']" % child.attrib.get("name")): + if child.attrib.get("modifiers"): field.attrib['modifiers'] = child.attrib.get('modifiers') + if child.attrib.get("on_change"): + field.attrib["on_change"] = child.attrib.get("on_change") node.getparent().replace(node, tree) arch = etree.tostring(doc) break