500: Internal Server Error
QWeb
Error message:
Error to render compiling AST IndexError: tuple index out of range Template: website_sale.product Path: /t/t[4]/div/section/div[2]/div[2]/div[4]/t Node: <t t-if="product.product_variant_ids[0]"> <t t-set="variant" t-value="product.product_variant_ids[0].sudo()"/> <t t-if="variant.product_attribute_label_ids"> <p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;"> <t t-set="co" t-value="len(variant.product_attribute_label_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_attribute_label_ids" t-as="label"> <t t-esc="label.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> <t t-if="variant.product_ingredient_values_ids"> <p class="title_ingri" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Ingrediente pentru 1 porție: </p> <p class="ingri" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_ingredient_values_ids)"/> <t t-set="counter" t-value="1"/> <t t-set="ingri_ids" t-value="variant.product_ingredient_values_ids.sorted(lambda i: i.value, reverse=True)"/> <t t-foreach="ingri_ids" t-as="ingri"> <t t-esc="ingri.product_id.name"/> <t t-esc="int(ingri.value) if ingri.value > 1 else round(ingri.value, 2)"/> <t t-esc="ingri.uom_id.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> <t t-if="variant.product_energy_values_ids"> <p class="title_energy" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Valori nutriționale pentru <t t-if="variant.uom_id.measure_type == 'unit'"> 1 porţie: </t> <t t-elif="variant.uom_id.measure_type == 'volume'"> 100 ml: </t> <t t-else=""> 100 g: </t> </p> <p class="energy" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_energy_values_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_energy_values_ids" t-as="energy"> <t t-if="energy.key_id.name"> <t t-esc="energy.key_id.name"/> <t t-esc="round(energy.value_per_100_g, 2)"/> <t t-esc="energy.uom_id.name"/> <t t-if="energy.key_id.nutrient_secondary_uom_id"> <span> / </span> <t t-esc="round(energy.uom_id._compute_quantity(energy.value_per_100_g, energy.key_id.nutrient_secondary_uom_id), 2)"/> <t t-esc="energy.key_id.nutrient_secondary_uom_id.name"/> </t> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </t> </p> </t> <t t-if="variant.product_allergen_ids"> <p class="title_allergen" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Alergeni: </p> <p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_allergen_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_allergen_ids" t-as="allergen"> <t t-esc="allergen.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> <t t-if="variant.product_additive_ids"> <p class="title_additive" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Aditivi: </p> <p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_additive_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_additive_ids" t-as="additive"> <t t-esc="additive.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> </t>
The error occured while rendering the template website_sale.product
and evaluating the following expression: <t t-if="product.product_variant_ids[0]">
<t t-set="variant" t-value="product.product_variant_ids[0].sudo()"/>
<t t-if="variant.product_attribute_label_ids">
<p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;">
<t t-set="co" t-value="len(variant.product_attribute_label_ids)"/>
<t t-set="counter" t-value="1"/>
<t t-foreach="variant.product_attribute_label_ids" t-as="label">
<t t-esc="label.name"/>
<t t-if="counter < co">
<span class="coma" style="margin-left: -3px;">,</span>
</t>
<t t-set="counter" t-value="counter+1"/>
</t>
</p>
</t>
<t t-if="variant.product_ingredient_values_ids">
<p class="title_ingri" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;">
Ingrediente pentru 1 porție:
</p>
<p class="ingri" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;">
<t t-set="co" t-value="len(variant.product_ingredient_values_ids)"/>
<t t-set="counter" t-value="1"/>
<t t-set="ingri_ids" t-value="variant.product_ingredient_values_ids.sorted(lambda i: i.value, reverse=True)"/>
<t t-foreach="ingri_ids" t-as="ingri">
<t t-esc="ingri.product_id.name"/>
<t t-esc="int(ingri.value) if ingri.value > 1 else round(ingri.value, 2)"/>
<t t-esc="ingri.uom_id.name"/>
<t t-if="counter < co">
<span class="coma" style="margin-left: -3px;">,</span>
</t>
<t t-set="counter" t-value="counter+1"/>
</t>
</p>
</t>
<t t-if="variant.product_energy_values_ids">
<p class="title_energy" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;">
Valori nutriționale pentru
<t t-if="variant.uom_id.measure_type == 'unit'">
1 porţie:
</t>
<t t-elif="variant.uom_id.measure_type == 'volume'">
100 ml:
</t>
<t t-else="">
100 g:
</t>
</p>
<p class="energy" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;">
<t t-set="co" t-value="len(variant.product_energy_values_ids)"/>
<t t-set="counter" t-value="1"/>
<t t-foreach="variant.product_energy_values_ids" t-as="energy">
<t t-if="energy.key_id.name">
<t t-esc="energy.key_id.name"/>
<t t-esc="round(energy.value_per_100_g, 2)"/>
<t t-esc="energy.uom_id.name"/>
<t t-if="energy.key_id.nutrient_secondary_uom_id">
<span> / </span>
<t t-esc="round(energy.uom_id._compute_quantity(energy.value_per_100_g, energy.key_id.nutrient_secondary_uom_id), 2)"/>
<t t-esc="energy.key_id.nutrient_secondary_uom_id.name"/>
</t>
<t t-if="counter < co">
<span class="coma" style="margin-left: -3px;">,</span>
</t>
<t t-set="counter" t-value="counter+1"/>
</t>
</t>
</p>
</t>
<t t-if="variant.product_allergen_ids">
<p class="title_allergen" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;">
Alergeni:
</p>
<p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;">
<t t-set="co" t-value="len(variant.product_allergen_ids)"/>
<t t-set="counter" t-value="1"/>
<t t-foreach="variant.product_allergen_ids" t-as="allergen">
<t t-esc="allergen.name"/>
<t t-if="counter < co">
<span class="coma" style="margin-left: -3px;">,</span>
</t>
<t t-set="counter" t-value="counter+1"/>
</t>
</p>
</t>
<t t-if="variant.product_additive_ids">
<p class="title_additive" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;">
Aditivi:
</p>
<p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;">
<t t-set="co" t-value="len(variant.product_additive_ids)"/>
<t t-set="counter" t-value="1"/>
<t t-foreach="variant.product_additive_ids" t-as="additive">
<t t-esc="additive.name"/>
<t t-if="counter < co">
<span class="coma" style="margin-left: -3px;">,</span>
</t>
<t t-set="counter" t-value="counter+1"/>
</t>
</p>
</t>
</t>
Traceback
Traceback (most recent call last): File "/opt/odoo13/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn return compiled(self, append, new, options, log) File "<template>", line 1, in template_website_sale_product_2612 File "<template>", line 7, in body_call_content_2610 File "/opt/odoo13/odoo/models.py", line 5481, in __getitem__ return self.browse((self._ids[key],)) IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/odoo13/odoo/addons/base/models/ir_http.py", line 229, in _dispatch result = request.dispatch() File "/opt/odoo13/odoo/http.py", line 803, in dispatch r = self._call_function(**self.params) File "/opt/odoo13/odoo/http.py", line 345, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo13/odoo/service/model.py", line 93, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo13/odoo/http.py", line 341, in checked_call result.flatten() File "/opt/odoo13/odoo/http.py", line 1230, in flatten self.response.append(self.render()) File "/opt/odoo13/odoo/http.py", line 1223, in render return env["ir.ui.view"].render_template(self.template, self.qcontext) File "/opt/odoo13/odoo/addons/base/models/ir_ui_view.py", line 1154, in render_template return self.browse(self.get_view_id(template)).render(values, engine) File "/var/www/laceaun_odoo13/addons/addons/website/models/ir_ui_view.py", line 335, in render return super(View, self).render(values, engine=engine, minimal_qcontext=minimal_qcontext) File "/var/www/laceaun_odoo13/addons/addons/web_editor/models/ir_ui_view.py", line 25, in render return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext) File "/opt/odoo13/odoo/addons/base/models/ir_ui_view.py", line 1162, in render return self.env[engine].render(self.id, qcontext) File "/opt/odoo13/odoo/addons/base/models/ir_qweb.py", line 58, in render result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context) File "/opt/odoo13/odoo/addons/base/models/qweb.py", line 259, in render self.compile(template, options)(self, body.append, values or {}) File "/opt/odoo13/odoo/addons/base/models/qweb.py", line 338, in _compiled_fn raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name) odoo.addons.base.models.qweb.QWebException: tuple index out of range Traceback (most recent call last): File "/opt/odoo13/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn return compiled(self, append, new, options, log) File "<template>", line 1, in template_website_sale_product_2612 File "<template>", line 7, in body_call_content_2610 File "/opt/odoo13/odoo/models.py", line 5481, in __getitem__ return self.browse((self._ids[key],)) IndexError: tuple index out of range Error to render compiling AST IndexError: tuple index out of range Template: website_sale.product Path: /t/t[4]/div/section/div[2]/div[2]/div[4]/t Node: <t t-if="product.product_variant_ids[0]"> <t t-set="variant" t-value="product.product_variant_ids[0].sudo()"/> <t t-if="variant.product_attribute_label_ids"> <p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;"> <t t-set="co" t-value="len(variant.product_attribute_label_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_attribute_label_ids" t-as="label"> <t t-esc="label.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> <t t-if="variant.product_ingredient_values_ids"> <p class="title_ingri" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Ingrediente pentru 1 porție: </p> <p class="ingri" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_ingredient_values_ids)"/> <t t-set="counter" t-value="1"/> <t t-set="ingri_ids" t-value="variant.product_ingredient_values_ids.sorted(lambda i: i.value, reverse=True)"/> <t t-foreach="ingri_ids" t-as="ingri"> <t t-esc="ingri.product_id.name"/> <t t-esc="int(ingri.value) if ingri.value > 1 else round(ingri.value, 2)"/> <t t-esc="ingri.uom_id.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> <t t-if="variant.product_energy_values_ids"> <p class="title_energy" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Valori nutriționale pentru <t t-if="variant.uom_id.measure_type == 'unit'"> 1 porţie: </t> <t t-elif="variant.uom_id.measure_type == 'volume'"> 100 ml: </t> <t t-else=""> 100 g: </t> </p> <p class="energy" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_energy_values_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_energy_values_ids" t-as="energy"> <t t-if="energy.key_id.name"> <t t-esc="energy.key_id.name"/> <t t-esc="round(energy.value_per_100_g, 2)"/> <t t-esc="energy.uom_id.name"/> <t t-if="energy.key_id.nutrient_secondary_uom_id"> <span> / </span> <t t-esc="round(energy.uom_id._compute_quantity(energy.value_per_100_g, energy.key_id.nutrient_secondary_uom_id), 2)"/> <t t-esc="energy.key_id.nutrient_secondary_uom_id.name"/> </t> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </t> </p> </t> <t t-if="variant.product_allergen_ids"> <p class="title_allergen" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Alergeni: </p> <p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_allergen_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_allergen_ids" t-as="allergen"> <t t-esc="allergen.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> <t t-if="variant.product_additive_ids"> <p class="title_additive" style="display:flex;font-weight: 700;font-size: 13.5px;line-height: 17px;"> Aditivi: </p> <p class="allergen" style="margin-bottom: 20px;font-size: 13.5px;line-height: 17px;text-transform: lowercase;"> <t t-set="co" t-value="len(variant.product_additive_ids)"/> <t t-set="counter" t-value="1"/> <t t-foreach="variant.product_additive_ids" t-as="additive"> <t t-esc="additive.name"/> <t t-if="counter < co"> <span class="coma" style="margin-left: -3px;">,</span> </t> <t t-set="counter" t-value="counter+1"/> </t> </p> </t> </t>