diff --git a/addons/account_facturx/models/account_move.py b/addons/account_facturx/models/account_move.py index 757164370b4..81c2d67d403 100644 --- a/addons/account_facturx/models/account_move.py +++ b/addons/account_facturx/models/account_move.py @@ -329,4 +329,5 @@ class AccountMove(models.Model): raise UserError(_('No decoder was found for the xml file: {}. The file is badly formatted, not supported or the decoder is not installed').format(attachment.name)) def _remove_ocr_option(self): - self.write({'extract_state': 'done'}) + if 'extract_state' in self: + self.write({'extract_state': 'done'})