From 1f8d94d700b418b151aff7d8a4370ff7bbdfe594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 3 Apr 2021 23:30:21 +0200 Subject: [PATCH] Use explicit list of product types for stock move issue10225 review361481002 --- sale.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sale.py b/sale.py index f97eb10220..3f22657b48 100644 --- a/sale.py +++ b/sale.py @@ -209,10 +209,12 @@ class Sale(metaclass=PoolMeta): pool = Pool() Date = pool.get('ir.date') Currency = pool.get('currency.currency') + Move = pool.get('stock.move') stockable = any( line.quantity >= 0 for line in self.lines if line.type == 'line' - and line.product and line.product.type != 'service') + and line.product + and line.product.type in Move.get_product_types()) if self.carrier and stockable: with Transaction().set_context(self._get_carrier_context()): cost, currency_id = self.carrier.get_sale_price()