details: https://code.tryton.org/tryton/commit/34ea681a75a4
branch: 7.6
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 | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (18 lines):
diff -r 50b742988340 -r 34ea681a75a4 modules/purchase/purchase.py
--- a/modules/purchase/purchase.py Thu Oct 30 00:59:07 2025 +0100
+++ b/modules/purchase/purchase.py Thu Oct 30 01:11:22 2025 +0100
@@ -759,9 +759,11 @@
def check_for_quotation(self):
for line in self.line_lines:
- if (not line.to_location
- and line.product
- and line.movable):
+ if (line.quantity or 0) >= 0:
+ location = line.to_location
+ else:
+ location = line.from_location
+ if ((not location or not line.warehouse) and line.movable):
raise PurchaseQuotationError(
gettext('purchase.msg_warehouse_required_for_quotation',
purchase=self.rec_name))