Reviewers: ,
Description:
trytond: Set correct instanciate for selection_change_with
Please review this at http://codereview.tryton.org/886002/
Affected files:
M trytond/model/model.py
Index: trytond/model/model.py
===================================================================
--- a/trytond/model/model.py
+++ b/trytond/model/model.py
@@ -72,7 +72,9 @@
if isinstance(field, (fields.Selection, fields.Reference)) \
and not isinstance(field.selection, (list, tuple)) \
and field.selection not in cls.__rpc__:
- cls.__rpc__[field.selection] = RPC()
+ instanciate = 0 if field.selection_change_with else None
+ cls.__rpc__.setdefault(field.selection,
+ RPC(instanciate=instanciate))
for attribute in
('on_change', 'on_change_with', 'autocomplete'):
function_name = '%s_%s' % (attribute, field_name)