[FIX] osv/fields.py: enable argument 'obj' in property fields

Fixes #1719
This commit is contained in:
Raphael Collet 2014-08-22 10:31:04 +02:00
parent 80c09a8d98
commit 2c6ee89080
1 changed files with 2 additions and 2 deletions

View File

@ -1584,12 +1584,12 @@ class property(function):
def __init__(self, **args):
if 'view_load' in args:
_logger.warning("view_load attribute is deprecated on ir.fields. Args: %r", args)
obj = 'relation' in args and args['relation'] or ''
args = dict(args)
args['obj'] = args.pop('relation', '') or args.get('obj', '')
super(property, self).__init__(
fnct=self._fnct_read,
fnct_inv=self._fnct_write,
fnct_search=self._fnct_search,
obj=obj,
multi='properties',
**args
)