details: https://code.tryton.org/tryton/commit/d9d8212c3054
branch: 8.2
user: Cédric Krier <[email protected]>
date: Wed Nov 04 19:44:16 2026 +0100
description:
Skip search for quantity with None operand
There is no quantity which has the value None so we can quickly return
a domain
with no result.
Closes #15184
(grafted from a728ba66bdb35fe863939f6d2495329e3fc6a330)
diffstat:
modules/stock/move.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diffs (13 lines):
diff -r f9ff4d1d9253 -r d9d8212c3054 modules/stock/move.py
--- a/modules/stock/move.py Wed Nov 04 16:11:06 2026 +0100
+++ b/modules/stock/move.py Wed Nov 04 19:44:16 2026 +0100
@@ -141,6 +141,9 @@
'with_childs', len(location_ids) == 1 or warehouse_only)
_, operator_, operand = domain
+ if operand is None:
+ return [('id', '=', -1)]
+
with transaction.set_context(cls._quantity_context(name)):
if ((len(location_ids) == 1 or warehouse_only)
and not context.get('stock_skip_warehouse')):