Hello, I am trying to do the same thing.
Within studio I can produce the barcode or QR, but when I print the Sales Order it is not there. I am reading that its a rendering issue but not able to find a solution. Are you able to share what you found, i am also on Odoo 18.4 Online Studio.
XML for my report as below. Thanks in advance.
<!-- QR version - code at the bottom -->
<data>
<xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[3]" meta-class="oe_structure"/>
<xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div" meta-class="oe_structure">
<br/>
</xpath>
<xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[4]" meta-class="oe_structure">
<br/>
</xpath>
<xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[5]" meta-t-if="not doc.signature" meta-class="oe_structure">
<br/>
</xpath>
<xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[7]" meta-t-if="( not doc.sale_order_option_ids or doc.state not in ['draft', 'sent'] or not any(not option.is_present for option in doc.sale_order_option_ids) )" meta-class="oe_structure">
<br/>
</xpath>
<xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[8]/div" meta-class="oe_structure">
<br/>
</xpath>
<xpath position="after" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[9]/p[@id='carrier_description']" meta-t-if="doc.carrier_id.carrier_description" meta-id="carrier_description">
<xpath position="move" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[9]/p[@id='carrier_description']/div" meta-t-out="doc.carrier_id.carrier_description"/>
<p><br/></p>
</xpath>
<xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[9]/div[2]" meta-class="oe_structure">
<br/>
</xpath>
<xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[10]" meta-class="oe_structure">
<br/>
</xpath>
<!-- Insert QR at the bottom of the page -->
<data>
<xpath expr="//div[@class='page']" position="inside">
<div class="barcode mt16" style="text-align:center;">
<img
t-att-src="'/report/barcode/?barcode_type=%s&value=%s&width=%s&height=%s' % ('QR', doc.name or '', 200, 200)"
alt="Sales Order QR"
style="max-width:100%;"
/>
<p style="text-align:center;">Sales Order: <t t-esc="doc.name"/></p>
</div>
</xpath>
</data>
</data>