Hi,
To fix the incorrect company name on your Odoo 18 reports, first, verify and correct the company's name and details in the Settings app under "Users & Companies > Companies." Ensure the correct company is also active for the user generating the report. If the issue persists, the report might be pulling the company name from a different context, requiring a code examination.
To customize the header and footer of the web.external_layout, create a new QWeb template in your module that inherits from web.external_layout. Use XPath expressions to target and replace the header and footer sections with your custom content. You can use HTML, CSS, and QWeb directives like t-field to dynamically display data. Remember to update your module's manifest, upgrade the module, and clear your browser cache to see the changes.
Try the following code.
<template id="your_module.report_external_layout_custom" inherit_id="web.external_layout">
<xpath expr="//div[@class='header']" position="replace">
<!-- Your custom header content here -->
<div class="header">
<div class="row">
<div class="col-6">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/>
</div>
<div class="col-6 text-right">
<h4 t-field="company.name"/>
</div>
</div>
</div>
</xpath>
<xpath expr="//div[@class='footer']" position="replace">
<!-- Your custom footer content here -->
<div class="footer">
<div class="text-center">
Page: <span class="page"/> of <span class="topage"/>
</div>
</div>
</xpath>
</template>
Reference:-
* https://www.cybrosys.com/blog/how-to-create-a-pdf-report-in-odoo-18
Hope it helps