Browse Source

avoid 'False' being printed on address labels for street2 / person

for/master
Harald Welte 5 years ago
parent
commit
074bc533cb
  1. 10
      models/dp_delivery_carrier.py

10
models/dp_delivery_carrier.py

@ -51,16 +51,22 @@ class DPDeliveryCarrier(models.Model):
def build_im_addr(self, im, partner):
(street, house) = split_street_house(partner.street)
country = get_alpha3_country_from_alpha2(partner.country_id.code)
street2 = None
if partner.street2:
street2 = partner.street2
addr = im.build_addr(street = street,
house = house,
additional = partner.street2,
additional = street2,
zipcode = partner.zip,
city = partner.city,
country = country)
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 = partner.name)
person = person)
else:
(first, last) = split_first_lastname(partner.name)
return im.build_pers_addr(first = first,

Loading…
Cancel
Save