details: https://code.tryton.org/tryton/commit/7e5197d5a61c
branch: default
user: Cédric Krier <[email protected]>
date: Thu May 21 10:26:44 2026 +0200
description:
Test origin from sale instead of line to calculate cost for return sale
of product kit
Closes #14854
diffstat:
modules/product_kit/stock.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (14 lines):
diff -r fcdf3e07d2b9 -r 7e5197d5a61c modules/product_kit/stock.py
--- a/modules/product_kit/stock.py Tue May 19 10:53:56 2026 +0200
+++ b/modules/product_kit/stock.py Thu May 21 10:26:44 2026 +0200
@@ -122,8 +122,8 @@
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: