Reviewers: , Description: trytond: Fix Exception creating instance with One2One field
Please review this at http://codereview.tryton.org/852003/ Affected files: M trytond/model/modelstorage.py Index: trytond/model/modelstorage.py =================================================================== --- a/trytond/model/modelstorage.py +++ b/trytond/model/modelstorage.py @@ -952,7 +952,7 @@ domain = PYSONDecoder(env).decode(pyson_domain) relation_ids = [] if getattr(record, field_name): - if field._type in ('many2one',): + if field._type in ('many2one', 'one2one'): relation_ids.append( getattr(record, field_name).id) else: @@ -972,7 +972,7 @@ relation_ids = [] for record in records: if getattr(record, field_name): - if field._type in ('many2one',): + if field._type in ('many2one', 'one2one'): relation_ids.append( getattr(record, field_name).id) else:
