From 44ea2adda7fcd6458b048b2034b6db5d9182d788 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 12 Sep 2019 12:23:55 +0000 Subject: [PATCH] [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 closes odoo/odoo#36779 Signed-off-by: Raphael Collet (rco) --- odoo/fields.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/odoo/fields.py b/odoo/fields.py index cb91e4c29b1..da283c226d3 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -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