From 00e86b1552d1e5541a8dbf9411de5cfdb8990cc4 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Tue, 6 Jun 2023 11:34:47 +0000 Subject: [PATCH] [FIX] core: new record has one2many field with real records Part-of: odoo/odoo#124612 --- odoo/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/fields.py b/odoo/fields.py index 4ca6664fba7..703c76daef5 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -4524,7 +4524,7 @@ class One2many(_RelationalMulti): elif command[0] in (Command.CLEAR, Command.SET): # assign the given lines to the last record only cache.update(recs, self, itertools.repeat(())) - lines = comodel.browse(command[2] if command[0] == Command.SET else []) + lines = browse(command[2] if command[0] == Command.SET else []) cache.set(recs[-1], self, lines._ids)