Navigation Menu

Skip to content

Commit

Permalink
[FIX] avoid a crash when value is False for a M2O field
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed May 21, 2017
1 parent 71e0373 commit c6c1ac9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onchange_helper/models/ir_rule.py
Expand Up @@ -12,7 +12,7 @@ def get_new_values(model, record, on_change_result):
for fieldname, value in vals.iteritems():
if fieldname not in record:
column = model._fields[fieldname]
if column.type == 'many2one':
if value and column.type == 'many2one':
value = value[0] # many2one are tuple (id, name)
new_values[fieldname] = value
return new_values
Expand Down

0 comments on commit c6c1ac9

Please sign in to comment.