Hi
I want to call a custom python function in xml with t-tags (For example:
) but my template says: "I can't render the file. " Also says: " 'NoneType' object is not callable."
How can I call this function in my xml file correctly?
Also I can't call the "format_detetime" (from odoo/odoo/tools/mics.py)in some of my xml files with the same error
Thanks for helping.
Deze vraag is gerapporteerd
1
Beantwoorden
3303
Weergaven
There is many example in Odoo code, One of them in event email template:
t-set="date_begin" t-value="format_datetime(object.event_id.date_begin, tz='UTC', dt_format="yyyyMMdd'T'HHmmss'Z'")"/>Another example in survey template:
type="text" class="form-control datetimepicker-input o_survey_question_datetime bg-transparent text-dark rounded-0 p-0"
t-attf-data-target="#datetimepicker_#{question.id}" t-att-name="question.id"
t-att-value="format_datetime(answer_lines[0].value_datetime) if answer_lines else None"
t-att-data-question-type="question.question_type"/>Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden| Gerelateerde posts | Antwoorden | Weergaven | Activiteit | |
|---|---|---|---|---|
|
|
2
dec. 23
|
15131 | ||
|
|
3
jul. 22
|
25769 | ||
|
|
2
jun. 21
|
21062 | ||
|
|
0
sep. 20
|
5170 | ||
|
|
0
mei 16
|
6030 |