fix res.partner.title handling in Internetmarke Address Generation

We don't want to try to print the object, but the abbreviated version
of the title
This commit is contained in:
Harald Welte 2016-12-13 14:31:35 +01:00
parent 685c315fa3
commit 6403eb7151
1 changed files with 4 additions and 1 deletions

View File

@ -68,7 +68,10 @@ class DPDeliveryCarrier(models.Model):
person = None
if partner.name:
(first, last) = split_first_lastname(partner.name)
person = im.build_pers_name(first=first, last=last, title=partner.title)
title = None
if partner.title and partner.title.shortcut:
title = partner.title.shortcut
person = im.build_pers_name(first=first, last=last, title=title)
return im.build_comp_addr(company = partner.parent_id.name,
address = addr,
person = person)