Browse Source

FIX Use old name_get method to compute display_name field

pull/523/head
Juan Jose Scarafia 10 years ago
committed by Jairo Llopis
parent
commit
00e38e56be
  1. 15
      base_location/models/better_zip.py

15
base_location/models/better_zip.py

@ -46,12 +46,15 @@ class BetterZip(models.Model):
'country_id', 'country_id',
) )
def _get_display_name(self): def _get_display_name(self):
self.display_name = ('(%s) %s, %s, %s') % (
self.name or '',
self.city or '',
self.state_id and self.state_id.name or '',
self.country_id and self.country_id.name or '',
)
if self.name:
name = [self.name, self.city]
else:
name = [self.city]
if self.state_id:
name.append(self.state_id.name)
if self.country_id:
name.append(self.country_id.name)
self.display_name = ", ".join(name)
@api.onchange('state_id') @api.onchange('state_id')
def onchange_state_id(self): def onchange_state_id(self):

Loading…
Cancel
Save