details: https://code.tryton.org/tryton/commit/47e2db042390
branch: 7.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 c04d3f52d5da -r 47e2db042390 modules/purchase/purchase.py
--- a/modules/purchase/purchase.py Tue Oct 28 17:19:38 2025 +0100
+++ b/modules/purchase/purchase.py Thu Oct 30 01:11:22 2025 +0100
@@ -730,7 +730,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 or not line.warehouse)
and line.product
and line.product.type in line.get_move_product_types()):
raise PurchaseQuotationError(