details: https://code.tryton.org/tryton/commit/197506902331
branch: 8.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 4c6471a40d43 -r 197506902331 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
@@ -126,6 +126,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')):