Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2719 มุมมอง

Hi,


ever since I upgraded from odoo14 to 15, my custom reports are not encoding correctly anymore. The Euro symbol becomes Â â¬, same for umlauts like ö, ä etc. The non-custom modules encode correctly.

I started odoo in --dev=all mode, I upgraded my module a few times, I made sure every xml and py file has the correct encoding header. And yet the problem persists. 


What could be the issue here? 

อวตาร
ละทิ้ง

can you add relevant part of the custom code along with the question for better response.

ผู้เขียน

Of course, so here's an example:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="stock_production_lot_label">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="lot">
<div style="font-size: 4.5em;">
<h1 t-field="lot.product_id.name" />
<p>
<strong>Charge:</strong> <span t-field="lot.name" />
</p>
<t t-if="lot.removal_date">
<p>
<strong>MHD:</strong> <span t-esc="lot.removal_date.strftime('%d.%m.%Y')" />
</p>
</t>
<p>
<strong>Menge gesamt:</strong> <span t-esc="lot.product_qty" /> <span t.esc="lot.product_uom_id.name" />
<span t-field="lot.product_uom_id.name" groups="uom.group_uom"/>
</p>
</div>
</t>
</t>
</template>
</data>
</odoo>

ผู้เขียน

this will result in botched umlauts.

คำตอบที่ดีที่สุด

I found this solution:

add after web.html_container


meta charset="UTF-8"  


Thanks

ps. Pasting HTML here seems to be impossible. 

อวตาร
ละทิ้ง

I tried to paste html here but that seems to be impossible :-//

ผู้เขียน คำตอบที่ดีที่สุด

Ok I am answering here to push the question back up. 

As an example, this is one of my custom reports, that is now rendering with the wrong encoding:

Pasting code hardly works here, so here's a screenshot: https://i.imgur.com/srMS5ZK.png

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มี.ค. 25
2895
0
พ.ย. 22
2639
0
ก.พ. 22
4589
2
ม.ค. 24
3748
Change footer in Follow up reports แก้ไขแล้ว
2
พ.ค. 23
1973