[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:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user