Better guess "selection_change_with" attribute
Testing on the instance for Selection field is not enough because some field selection could come from a Function field. So it is better to use a duck typing style in this case. issue3649 review3451002
This commit is contained in:
1 parent
6b3f7fb250
commit
729aaa8a00
1 file changed
+2
-2
@@ -53,8 +53,8 @@ class Model(WarningErrorMixin, URLMixin, PoolBase):
|
||||
for attribute in ('on_change', 'on_change_with', 'autocomplete',
|
||||
'selection_change_with'):
|
||||
if attribute == 'selection_change_with':
|
||||
if (isinstance(field, fields.Selection)
|
||||
and isinstance(field.selection, basestring)):
|
||||
if isinstance(
|
||||
getattr(field, 'selection', None), basestring):
|
||||
function_name = field.selection
|
||||
else:
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user