Save the new ir.model.data instances before calling functions on them

Closes #14885
(grafted from 20d79a09c9a6a5b052048c83fd351f789cd63372)

--HG--
branch : 8.0
This commit is contained in:
Nicolas Évrard
2026-06-09 18:33:51 +02:00
parent ca293f43e2
commit f5122cd85b
+2
View File
@@ -595,6 +595,8 @@ class TrytondXmlHandler(sax.handler.ContentHandler):
if new_values:
to_update += [[record], values]
if values.keys() - set(mdata.field_names):
if mdata.id is None:
mdata.save()
field_names = dict(mdata.get_field_names()).keys()
mdata.field_names = tuple(
(set(mdata.field_names) & field_names) | values.keys())