From 5271404566cc74584fcb40dcd66bc1f215562ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 30 Oct 2025 01:11:22 +0100 Subject: [PATCH] Test from location when checking warehouse for purchase line with negative quantity Closes #14333 (grafted from f21002c5cb1882a5cc6e7375aec7db45fc56698f) --HG-- branch : 6.0 --- modules/purchase/purchase.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/purchase/purchase.py b/modules/purchase/purchase.py index 3a42cbed94..63fcfa3d33 100644 --- a/modules/purchase/purchase.py +++ b/modules/purchase/purchase.py @@ -745,7 +745,11 @@ class Purchase( def check_for_quotation(self): for line in self.lines: - if (not line.to_location + if (line.quantity or 0) >= 0: + location = line.to_location + else: + location = line.from_location + if (not location and line.product and line.product.type in ('goods', 'assets')): raise PurchaseQuotationError(