[FIX] website_sale_aplicoop: Fix NoneType error in eskaera_shop_products template

- Add fallback values for display_price in t-attf-data-product-price
  attribute to prevent TypeError when display_price is None
- Add fallback for product.uom_id.category_id.name to prevent None errors
- Use chained 'or' operators to ensure safe fallback:
  * display_price or product.list_price or 0
  * product.uom_id.category_id.name if exists else empty string

This fixes the QWeb rendering error:
'TypeError: NoneType object is not callable'

The error occurred when the template tried to render data attributes
with None values. Now the template safely handles missing or None values
by using sensible defaults.
This commit is contained in:
snt 2026-02-16 18:44:53 +01:00
parent 9000e92324
commit df572337d6

View file

@ -1216,8 +1216,8 @@
t-attf-data-order-id="{{ group_order.id if 'group_order' in locals() else '' }}"
t-attf-data-product-id="{{ product.id }}"
t-attf-data-product-name="{{ product.name }}"
t-attf-data-product-price="{{ display_price }}"
t-attf-data-uom-category="{{ product.uom_id.category_id.name }}"
t-attf-data-product-price="{{ display_price or product.list_price or 0 }}"
t-attf-data-uom-category="{{ product.uom_id.category_id.name if product.uom_id.category_id else '' }}"
>
<div class="qty-control">
<label