[FIX] account_edi: We should delete the last info/warning/error msg when success to not have something weird still in the view

closes odoo/odoo#85818

X-original-commit: dab20ed277e32179244ae00df0b8d1c7c19011c6
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
Josse Colpaert
2022-03-04 13:12:51 +00:00
parent 3f6c210745
commit 83859de33c
@@ -127,7 +127,11 @@ class AccountEdiDocument(models.Model):
if not old_attachment.res_model or not old_attachment.res_id:
attachments_to_unlink |= old_attachment
if move_result.get('success') is True:
document.state = 'sent'
document.write({
'state': 'sent',
'error': False,
'blocking_level': False,
})
else:
document.write({
'error': move_result.get('error', False),