Browse Source

use partner.is_company as indicator for company address

for/master
Harald Welte 5 years ago
parent
commit
663fde65f4
  1. 16
      models/dp_delivery_carrier.py

16
models/dp_delivery_carrier.py

@ -60,13 +60,17 @@ class DPDeliveryCarrier(models.Model):
zipcode = partner.zip,
city = partner.city,
country = country)
if partner.parent_id.name:
person = None
if partner.name:
person = partner.name
if partner.is_company:
return im.build_comp_addr(company = partner.parent_id.name,
address = addr,
person = person)
address = addr)
else:
if partner.parent_id.name:
person = None
if partner.name:
person = partner.name
return im.build_comp_addr(company = partner.parent_id.name,
address = addr,
person = person)
else:
(first, last) = split_first_lastname(partner.name)
return im.build_pers_addr(first = first,

Loading…
Cancel
Save