[FIX] fields: conversion of Many2oneReference value

The value of that field can be given as a dict containing the fields of
the corresponding record.

Co-authored with Michael Mattiello <mcm@odoo.com>

closes odoo/odoo#36779

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
Raphael Collet
2019-09-12 12:23:55 +00:00
parent 21fa7ca76f
commit 44ea2adda7
+1 -2
View File
@@ -2470,8 +2470,7 @@ class Many2oneReference(Integer):
# cache format: id or None
if isinstance(value, BaseModel):
value = value._ids[0] if value._ids else None
return value
return super().convert_to_cache(value, record, validate)
def _remove_inverses(self, records, value):
# TODO: unused