Fix DeprecationWarning: on_change argument is deprecated, use the depends decorator

This commit is contained in:
jmartin 2014-05-26 17:15:44 +02:00
parent 6871afad92
commit b0edd121c2
1 changed files with 3 additions and 2 deletions

View File

@ -51,9 +51,10 @@ class Account(ModelSQL, ModelView):
class Line(ModelSQL, ModelView):
__name__ = 'account.move.line'
party_required = fields.Function(fields.Boolean('Party Required',
on_change_with=['account']), 'on_change_with_party_required')
party_required = fields.Function(fields.Boolean('Party Required'),
'on_change_with_party_required')
@fields.depends('account')
def on_change_with_party_required(self, name=None):
if self.account:
return self.account.party_required