[ADD] upgrade_analysis: generate noupdate_changes for template tag

pull/2826/head
Roy Le 2022-07-05 16:27:37 +07:00 committed by Stefan Rijnhart
parent 0f790ca336
commit c69be433ca
1 changed files with 8 additions and 1 deletions

View File

@ -324,6 +324,13 @@ class UpgradeAnalysis(models.Model):
if remote_record is None and not module_xmlid: if remote_record is None and not module_xmlid:
continue 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( element = etree.Element(
"record", id=xml_id, model=local_record.attrib["model"] "record", id=xml_id, model=local_record.attrib["model"]
) )
@ -389,7 +396,7 @@ class UpgradeAnalysis(models.Model):
self, data_node, records_update, records_noupdate, module_name self, data_node, records_update, records_noupdate, module_name
): ):
noupdate = nodeattr2bool(data_node, "noupdate", False) 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( self._process_record_node(
record, noupdate, records_update, records_noupdate, module_name record, noupdate, records_update, records_noupdate, module_name
) )