From 587d05f7ac1648e342f7ca95eb1e866f6fbc42dc 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 bfd04a6c4..81ea00132 100644 --- a/stock_inventory/models/stock_quant.py +++ b/stock_inventory/models/stock_quant.py @@ -51,8 +51,8 @@ class StockQuant(models.Model): } ) 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):