[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:
+1
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user