Browse Source

fix build_im_addr() for the case when both company + person name are given

When a company name and person name are given, we need to first generate
a PersonName object using inema build_pers_name() method, and then pass
that as 'person' kwarg into the build_comp_addr() method.  We cannot
simply pass alon the string name as the code did so far.

This requires python-inema 0.2 or later, but it seems like a version
dependency on an external python module cannot be expressed in
__openerp__.py
for/master
Harald Welte 5 years ago
parent
commit
2f31909b6b
  1. 3
      models/dp_delivery_carrier.py

3
models/dp_delivery_carrier.py

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

Loading…
Cancel
Save