Merge PR #2368 into 15.0

Signed-off-by pedrobaeza
pull/2416/head
OCA-git-bot 2022-10-05 00:51:59 +00:00
commit c0f96bf008
1 changed files with 8 additions and 1 deletions

View File

@ -325,6 +325,13 @@ class UpgradeAnalysis(models.Model):
if remote_record is None and not module_xmlid:
continue
if local_record.tag == "template":
old_tmpl = etree.tostring(remote_record, encoding="utf-8")
new_tmpl = etree.tostring(local_record, encoding="utf-8")
if old_tmpl != new_tmpl:
odoo.append(local_record)
continue
element = etree.Element(
"record", id=xml_id, model=local_record.attrib["model"]
)
@ -390,7 +397,7 @@ class UpgradeAnalysis(models.Model):
self, data_node, records_update, records_noupdate, module_name
):
noupdate = nodeattr2bool(data_node, "noupdate", False)
for record in data_node.xpath("./record"):
for record in data_node.xpath("./record") + data_node.xpath("./template"):
self._process_record_node(
record, noupdate, records_update, records_noupdate, module_name
)