[FIX] account_edi: allow to post an invoice w/ existing edi documents

Following odoo/odoo@44a4cdb, `attachment_id` is restricted, so force
updating it's value as sudo() when posting an invoice having existing
EDI documents.

closes odoo/odoo#111426

X-original-commit: 6b101d5ff0ad78b9ae2ad312f362c2224e7af457
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
This commit is contained in:
Xavier ALT
2023-01-31 14:04:16 +01:00
parent 5db5206cbe
commit a3dbd47b1f
+1 -1
View File
@@ -312,7 +312,7 @@ class AccountMove(models.Model):
existing_edi_document = move.edi_document_ids.filtered(lambda x: x.edi_format_id == edi_format)
if existing_edi_document:
existing_edi_document.write({
existing_edi_document.sudo().write({
'state': 'to_send',
'attachment_id': False,
})