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):