|
@ -30,7 +30,7 @@ class BetterZip(orm.Model): |
|
|
_order = "priority" |
|
|
_order = "priority" |
|
|
|
|
|
|
|
|
_columns = {'priority': fields.integer('Priority', deprecated=True), |
|
|
_columns = {'priority': fields.integer('Priority', deprecated=True), |
|
|
'name': fields.char('ZIP', required=True), |
|
|
|
|
|
|
|
|
'name': fields.char('ZIP'), |
|
|
'city': fields.char('City', required=True), |
|
|
'city': fields.char('City', required=True), |
|
|
'state_id': fields.many2one('res.country.state', 'State'), |
|
|
'state_id': fields.many2one('res.country.state', 'State'), |
|
|
'country_id': fields.many2one('res.country', 'Country'), |
|
|
'country_id': fields.many2one('res.country', 'Country'), |
|
@ -43,7 +43,10 @@ class BetterZip(orm.Model): |
|
|
def name_get(self, cursor, uid, ids, context=None): |
|
|
def name_get(self, cursor, uid, ids, context=None): |
|
|
res = [] |
|
|
res = [] |
|
|
for bzip in self.browse(cursor, uid, ids): |
|
|
for bzip in self.browse(cursor, uid, ids): |
|
|
|
|
|
if bzip.name: |
|
|
name = [bzip.name, bzip.city] |
|
|
name = [bzip.name, bzip.city] |
|
|
|
|
|
else: |
|
|
|
|
|
name = [bzip.city] |
|
|
if bzip.state_id: |
|
|
if bzip.state_id: |
|
|
name.append(bzip.state_id.name) |
|
|
name.append(bzip.state_id.name) |
|
|
if bzip.country_id: |
|
|
if bzip.country_id: |
|
|