[FIX] account_facturx: do not write non-existing fields
If a field does not exist, writing it creates a warning in the logs. This would for example prevent a valid test to pass. This is needed because extract_state is a field from account_invoice_extract, which is not a dependency of account_facturx. X-original-commit: bb03b05df39097a954388ba6b00c025989351f16
This commit is contained in:
@@ -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'})
|
||||
|
||||
Reference in New Issue
Block a user