details: https://code.tryton.org/tryton/commit/a728ba66bdb3
branch: default
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
diffstat:
modules/stock/move.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diffs (13 lines):
diff -r 2a01eb75fb1e -r a728ba66bdb3 modules/stock/move.py
--- a/modules/stock/move.py Wed Nov 04 16:23:53 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')):