Skip to content

Commit 13eaf26

Browse files
committed
[IMP] util.update_record_from_xml
Set the record in noupdate=False using the `force_noupdate` function, taking adventage of its new behavior of also updating the parent records.
1 parent 5096799 commit 13eaf26

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/util/records.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,20 +1098,18 @@ def __update_record_from_xml(
10981098

10991099
cr.execute(
11001100
"""
1101-
UPDATE ir_model_data d
1102-
SET noupdate = false
1103-
FROM ir_model_data o
1104-
WHERE o.id = d.id
1105-
AND d.module = %s
1106-
AND d.name = %s
1107-
RETURNING d.model, d.res_id, o.noupdate
1101+
SELECT model, res_id, noupdate
1102+
FROM ir_model_data
1103+
WHERE module = %s
1104+
AND name = %s
11081105
""",
11091106
[module, name],
11101107
)
11111108
if cr.rowcount:
11121109
model, res_id, noupdate = cr.fetchone()
11131110
if model == "ir.model":
11141111
return
1112+
force_noupdate(cr, xmlid, noupdate=False)
11151113
elif not force_create:
11161114
_logger.warning("Record %r not found in database. Skip update.", xmlid)
11171115
return

0 commit comments

Comments
 (0)