From 2bbaac9f2196f3bba4971ea8863852c25b6809e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 21 May 2026 10:26:44 +0200 Subject: [PATCH] Test origin from sale instead of line to calculate cost for return sale of product kit Closes #14854 (grafted from 7e5197d5a61cb5090d8a2c00ae4a12a25924aeda) --HG-- branch : 8.0 --- modules/product_kit/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/product_kit/stock.py b/modules/product_kit/stock.py index eec22e0a8d..0ac331695f 100644 --- a/modules/product_kit/stock.py +++ b/modules/product_kit/stock.py @@ -122,8 +122,8 @@ class MoveSale(metaclass=PoolMeta): and self.origin.quantity < 0 and self.from_location.type != 'storage' and self.to_location.type == 'storage' - and isinstance(self.origin.line.origin, Sale)): - sale = self.origin.line.origin + and isinstance(self.origin.line.sale.origin, Sale)): + sale = self.origin.line.sale.origin cost = Decimal(0) qty = Decimal(0) for move in sale.moves: