[FIX] fields: add property auto_join on many2many fields
This makes this property available on all relational fields, although the feature is currently not implemented on many2many fields.
This commit is contained in:
@@ -1972,6 +1972,7 @@ class Many2many(_RelationalMulti):
|
||||
'relation': None, # name of table
|
||||
'column1': None, # column of table referring to model
|
||||
'column2': None, # column of table referring to comodel
|
||||
'auto_join': False, # whether joins are generated upon search
|
||||
'limit': None, # optional limit to use upon read
|
||||
}
|
||||
|
||||
@@ -2014,6 +2015,7 @@ class Many2many(_RelationalMulti):
|
||||
_column_rel = property(attrgetter('relation'))
|
||||
_column_id1 = property(attrgetter('column1'))
|
||||
_column_id2 = property(attrgetter('column2'))
|
||||
_column_auto_join = property(attrgetter('auto_join'))
|
||||
_column_limit = property(attrgetter('limit'))
|
||||
|
||||
|
||||
|
||||
@@ -947,6 +947,7 @@ class many2many(_column):
|
||||
args['relation'] = self._rel
|
||||
args['column1'] = self._id1
|
||||
args['column2'] = self._id2
|
||||
args['auto_join'] = self._auto_join
|
||||
args['limit'] = self._limit
|
||||
return args
|
||||
|
||||
|
||||
Reference in New Issue
Block a user