details: https://code.tryton.org/tryton/commit/4e7a43318138
branch: 6.0
user: Cédric Krier <[email protected]>
date: Thu Oct 30 01:11:22 2025 +0100
description:
Test from location when checking warehouse for purchase line with
negative quantity
Closes #14333
(grafted from f21002c5cb1882a5cc6e7375aec7db45fc56698f)
diffstat:
modules/purchase/purchase.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (16 lines):
diff -r 2331d431f069 -r 4e7a43318138 modules/purchase/purchase.py
--- a/modules/purchase/purchase.py Thu Oct 30 01:00:12 2025 +0100
+++ b/modules/purchase/purchase.py Thu Oct 30 01:11:22 2025 +0100
@@ -745,7 +745,11 @@
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(