Use fields.depends decorator

issue3487
review2301002
This commit is contained in:
Cédric Krier
2014-01-26 14:29:13 +01:00
parent e6d38c524c
commit 361c98ed57
+4 -3
View File
@@ -12,10 +12,11 @@ __metaclass__ = PoolMeta
class Address:
__name__ = 'party.address'
google_maps_url = fields.Function(fields.Char('Google Maps',
on_change_with=['street', 'streetbis', 'zip', 'city', 'country',
'subdivision']), 'on_change_with_google_maps_url')
google_maps_url = fields.Function(fields.Char('Google Maps'),
'on_change_with_google_maps_url')
@fields.depends('street', 'streetbis', 'zip', 'city', 'country',
'subdivision')
def on_change_with_google_maps_url(self, name=None):
lang = Transaction().language[:2]
url = ''