Hi, i wonder how i can add some jinja extension
i want to add jinja2.ext.do
Thanks
Hi, i wonder how i can add some jinja extension
i want to add jinja2.ext.do
Thanks
I wonder too
Can you explain clearly what you want to do.
@rmehta yaa. i want to add “do” extension…because i want i can set parameter at loop and use it outside of the loop
Please guide…^^
Thanks…
Never worked with do extension. Have you tried to google? Where are you stuck?
item that sold is in 1 UOM , and i want to add total UOM included in deliverry note print format…
but i do not need this to be custom field for this actually…
Where are you stuck? You can always create a new print format
Hi, do you were able to achieve this? I need to use “do” extension as wello" extension as well.
Hi @bobzz_zone, @federico_calvo,
if I understand correctly you want a variable in Jinja to count with. Have you tried something like this:
Define variable
{% set vars = {'uom_count': 0} %}
Update (the if construct makes Jinja execute the update function )
{% if vars.update({'uom_count': vars.uom_count + 1}) %}{% endif %}
Use
{{ vars.uom_count }}
Hope this helps.
A little bit hacky but it works well.
Thank you!