Fallback to 0 when summing stock values of products

Closes #13581
(grafted from 929d753eaf33a2121362ab7429813a82e288e97a)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2024-10-09 20:15:47 +02:00
1 parent e30db1edfc
commit ed689b63a6
1 file changed
+1 -1
+1 -1
View File
@@ -168,7 +168,7 @@ class Template(metaclass=PoolMeta):
raise Exception('Bad argument')
sum_ = 0. if name != 'cost_value' else Decimal(0)
for product in self.products:
sum_ += getattr(product, name)
sum_ += getattr(product, name) or 0
return sum_
@classmethod