Closed mavaa closed 11 months ago
Hello!
This seems to be an issue with qweb templates rendered on the server. This repository is for Owl, which is the framework that renders template in the browser (so, not the same code!). @Gorash may know more about the problem.
Now, in your case, i would suggest to use a specific qweb feature: if you iterate in a t-foreach
loop, you get some additional useful variables, such as o_first
, which is true if this is the first iteration. This means that your code can probably be written like this:
<t t-foreach="i.package_level_ids" t-as="o">
[...]
<t t-if="not o_first">
<i class="fa fa-fw fa-circle"
style="font-size: 1px; vertical-align: middle; line-height: 1em; margin: 0 4px 0 3px;"/>
</t>
</t>
https://www.odoo.com/documentation/master/developer/reference/frontend/qweb.html#loops
That's great, thanks!
And also, I might be mistaken about the setting of the variable to True, when I removed the code, I got the exact same error, but from a different line, so it might look like Odoo isn't reporting the correct offending line here.. Will report back and possibly close as soon as I figure out what is actually happening here.
Sorry, I was mistaken in what the original issue was, after removing almost my entire template, it turned out to be an issue in a completely separate part of my code.
In Odoo 14, I had the following xml:
This way,
firstItem
was set to the boolean value True, then False, so I could do special styling for the first item in my list. However, after upgrading to Odoo 16, we get the following error:Seems that in Odoo 16, the value is set to the string "True", not the boolean (python) built in
True
. Is this a bug, or is there a way I can get the old behaviour back?