[IMP] ir_qweb: ir.qweb.field.contact allow to specify separator to format address

Allow to specify a separator char to have the address formatted on a single line e.g.
This commit is contained in:
Jeremy Kersten
2018-03-19 19:27:35 +01:00
parent 2feda047b7
commit 90dbca29f8
+2 -1
View File
@@ -460,12 +460,13 @@ class Contact(models.AbstractModel):
return False
opf = options and options.get('fields') or ["name", "address", "phone", "mobile", "email"]
opsep = options and options.get('separator') or "\n"
value = value.sudo().with_context(show_address=True)
name_get = value.name_get()[0][1]
val = {
'name': name_get.split("\n")[0],
'address': escape("\n".join(name_get.split("\n")[1:])).strip(),
'address': escape(opsep.join(name_get.split("\n")[1:])).strip(),
'phone': value.phone,
'mobile': value.mobile,
'city': value.city,