I have a piece of code like below
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_invoice_document">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=lang)" />
<t t-set="address">
<address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<div t-if="o.partner_id.vat" class="mt16"><t t-esc="o.company_id.country_id.vat_label or 'Tax ID'"/>: <span t-field="o.partner_id.vat"/></div>
</t>
<div class="page">
<div id="informations" class="row mt32 mb32">
<div class="col-auto mw-100 mb-2" t-if="o.name" name="description">
<strong>Description:</strong>
<p class="m-0" t-field="o.name"/>
</div>
</div>
</div>
</t>
</template>
</data>
</odoo>
I want to inherit and replace the informations div so i inherit the code like below using xpath
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="report_invoice_document_inherit" inherit_id="account.report_invoice_document">
<xpath expr="//div[@id='informations']" position="replace">
<div id="informations" class="row mt32 mb32">
<div class="col-auto mw-100 mb-2" t-if="o.date_invoice" name="invoice_date">
<strong>Invoice Date:</strong>
<p class="m-0" t-field="o.date_invoice"/>
</div>
</div>
</xpath>
</template>
</data>
</odoo>
The problem is, the above code and the xpath works fine when i test it in my local machine but it throws me an error as below when i deploy it to a server
Element '<xpath expr="//div[@id='informations']">' cannot be located in parent view
I have checked community code in server and everything seems to be fine. I want to know is there anything wrong in my code? or is it related to the xpath? What seems to cause the issue? Any help?
Also make sure that the corresponding div you have used in the xpath is not replaced or removed from the inheriting in any other custom module in the server.
will make sure, thank you!