From 246d68dbca300f5fb10346eca372139bb9237fb9 Mon Sep 17 00:00:00 2001 From: Joan Sisquella Date: Wed, 24 Apr 2024 12:27:16 +0200 Subject: [PATCH] [FIX] stock_inventory: only set to done adjustment if there is an adjustment --- stock_inventory/models/stock_quant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_inventory/models/stock_quant.py b/stock_inventory/models/stock_quant.py index bfd04a6c4b99..81ea00132297 100644 --- a/stock_inventory/models/stock_quant.py +++ b/stock_inventory/models/stock_quant.py @@ -51,8 +51,8 @@ def _apply_inventory(self): } ) rec.to_do = False - if self.env.company.stock_inventory_auto_complete: - adjustment.action_auto_state_to_done() + if adjustment and self.env.company.stock_inventory_auto_complete: + adjustment.action_auto_state_to_done() return res def _get_inventory_fields_write(self):