details: https://code.tryton.org/tryton/commit/9dcc1f4b4dde
branch: default
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
diffstat:
modules/stock/inventory.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r c80d27c58f5b -r 9dcc1f4b4dde 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)