From d35d519ea1b50a93ae4078f0c46b078a266c4592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 Nov 2023 16:42:45 +0100 Subject: [PATCH] Do not try to compute promotion quantity for lines without type line Closes #12351 --- modules/sale_promotion/sale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/sale_promotion/sale.py b/modules/sale_promotion/sale.py index b67c5dc3c2..21ce909c54 100644 --- a/modules/sale_promotion/sale.py +++ b/modules/sale_promotion/sale.py @@ -225,6 +225,8 @@ class Promotion( if self.unit: quantity = 0 for line in sale.lines: + if line.type != 'line': + continue if self.is_valid_sale_line(line): quantity += Uom.compute_qty(line.unit, line.quantity, self.unit)