diff --git a/modules/sale_promotion/sale.py b/modules/sale_promotion/sale.py index f341f6256a..9fe0fc2e2e 100644 --- a/modules/sale_promotion/sale.py +++ b/modules/sale_promotion/sale.py @@ -282,12 +282,13 @@ class Promotion( return False elif self.products and line.product not in self.products: return False - elif (self.categories - and not set(parents(line.product.categories_all)).intersection( - self.categories)): - return False - else: - return True + elif self.categories: + if not line.product: + return False + categories = set(parents(line.product.categories_all)) + if not categories.intersection(self.categories): + return False + return True def apply(self, sale): applied = False