From df572337d6adf91ea639821f03c1784375f3c49f Mon Sep 17 00:00:00 2001 From: snt Date: Mon, 16 Feb 2026 18:44:53 +0100 Subject: [PATCH] [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. --- website_sale_aplicoop/views/website_templates.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website_sale_aplicoop/views/website_templates.xml b/website_sale_aplicoop/views/website_templates.xml index 5ea8017..8719540 100644 --- a/website_sale_aplicoop/views/website_templates.xml +++ b/website_sale_aplicoop/views/website_templates.xml @@ -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 '' }}" >