跳至內容
選單
此問題已被標幟
2 回覆
1339 瀏覽次數

Hello odooers,

I search a lot but didn't found so I count on you.

I have developed some reports for my module and it occurs that I have insert variables to my text strings. Like here:

_("You have %s invoices wainting") % len(invoices)
In Python there is no problem. But how do I build this in qweb xml reports? Especially when I'm using html elements?


Thanks in advance for a short hint!


Regards,

Tastenmeister

頭像
捨棄
作者 最佳答案

Hi Ermin,

many many thanks for your answer! My question is more about how to put this in xml/html output if I'm going to print a report (like pdf).

Should I use a t-attr to insert the python code?


Correct me, if I'm wrong, but normally xml is coded like this:

There are waiting for you until to be edited:



So when I'm using build in translation function, odoo is giving me either none of the string or just 3 parts, which is bad for translation.

So how can I output the whole block in xml, similar to:
("There are %s waiting for you until %s to be  edited:", $doc.invoices_amount, $doc.return_date)

I'm really glad, that you're helping me about this, since there is only very few documentation about translations when it comes to using in xml reports.

All the best,

Tastenmeister

頭像
捨棄
最佳答案

("%s Rechnungen warten auf Sie")

("Auf Sie warten %s Rechnungen")

頭像
捨棄