Commit 661ade20 authored by Pedro M. Baeza's avatar Pedro M. Baeza Committed by GitHub

Merge pull request #72 from hbrunn/master-support_old_api

[FIX] support versions without _fields
parents b1d21017 ddc733e5
......@@ -804,7 +804,7 @@ def m2o_to_x2m(cr, model, table, field, source_field):
.. versionadded:: 8.0
"""
columns = getattr(model, '_columns', getattr(model, '_fields'))
columns = getattr(model, '_columns', False) or getattr(model, '_fields')
if not columns.get(field):
do_raise("m2o_to_x2m: field %s doesn't exist in model %s" % (
field, model._name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment