Skip to content

Commit 835530b

Browse files
committed
[FIX] util.update_record_from_xml: force flush
Allow SQL access to the record after function call. Part-of: #36
1 parent 30ee86b commit 835530b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util/records.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from .indirect_references import indirect_references
2525
from .inherit import direct_inherit_parents, for_each_inherit
2626
from .misc import parse_version, version_gte
27-
from .orm import env
27+
from .orm import env, flush
2828
from .pg import (
2929
PGRegexp,
3030
_get_unique_indexes_with,
@@ -860,6 +860,8 @@ def add_ref(ref):
860860
importer = xml_import(cr_or_env, from_module, idref={}, mode="update")
861861
kw = {"mode": "update"} if parse_version("8.0") <= parse_version(release.series) <= parse_version("12.0") else {}
862862
importer.parse(new_root, **kw)
863+
if version_gte("13.0"):
864+
flush(env(cr)["base"])
863865

864866
if noupdate:
865867
force_noupdate(cr, xmlid, noupdate=True)

0 commit comments

Comments
 (0)