details: https://code.tryton.org/tryton/commit/374403742370
branch: 8.2
user: Sergi Almacellas Abellana <[email protected]>
date: Mon Nov 23 14:25:07 2026 +0100
description:
Compute inventory quantity when actual quantity is zero
Closes #15267
(grafted from 9dcc1f4b4dde4ed25bf2a27d5ed665c14d3736ac)
diffstat:
modules/stock/inventory.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r e5e1518e7d6e -r 374403742370 modules/stock/inventory.py
--- a/modules/stock/inventory.py Thu Nov 19 19:02:21 2026 +0100
+++ b/modules/stock/inventory.py Mon Nov 23 14:25:07 2026 +0100
@@ -467,7 +467,7 @@
@fields.depends('quantity', 'expected_quantity', 'unit')
def on_change_with_quantity_variation(self, name=None):
- if self.quantity and self.expected_quantity:
+ if self.quantity is not None and self.expected_quantity is not None:
diff = self.quantity - self.expected_quantity
if self.unit:
diff = self.unit.round(diff)