Advertisement
Guest User

Test

a guest
Jul 17th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. def compute_shipping_address_name(self):
  2. for record in self:
  3. shipping_addresses = self.search([('parent_id', '=', record.id), ('type', '=', 'delivery')])
  4.  
  5. child_lines = []
  6. for shipp in shipping_addresses:
  7. line = '{ship_name} {ship_street} {ship_state} {ship_zip}'.format(ship_name=shipp.name,
  8. ship_street=shipp.street,
  9. ship_state=shipp.state_id.name,
  10. ship_zip=shipp.zip)
  11. child_lines.append(line)
  12. record.shipping_address_name = '|'.join(child_lines)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement