details: https://code.tryton.org/tryton/commit/189fb83e16fa
branch: 7.0
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 e74f0ea22b53 -r 189fb83e16fa modules/stock/move.py
--- a/modules/stock/move.py Wed Nov 04 16:07:16 2026 +0100
+++ b/modules/stock/move.py Wed Nov 04 19:44:16 2026 +0100
@@ -128,6 +128,9 @@
'with_childs', len(location_ids) == 1)
_, operator_, operand = domain
+ if operand is None:
+ return [('id', '=', -1)]
+
with Transaction().set_context(cls._quantity_context(name)):
if (len(location_ids) == 1
and not Transaction().context.get('stock_skip_warehouse')):