콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
1341 화면

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")

아바타
취소