From 529d0e8e9fdc84188e41db67e7ad0e2e7405de15 Mon Sep 17 00:00:00 2001 From: wan Date: Wed, 26 Aug 2020 09:20:47 +0000 Subject: [PATCH] [FIX] account_edi: manage soft post We don't want to send the EDI for documents set to be posted automatically in the future. closes odoo/odoo#56607 X-original-commit: 2e783a68b544515258af077e1cc63402f5b7f9c8 Signed-off-by: Laurent Smet Signed-off-by: wan --- addons/account_edi/models/account_move.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account_edi/models/account_move.py b/addons/account_edi/models/account_move.py index 2f35c80a017..88bc1511227 100644 --- a/addons/account_edi/models/account_move.py +++ b/addons/account_edi/models/account_move.py @@ -130,10 +130,10 @@ class AccountMove(models.Model): def _post(self, soft=True): # OVERRIDE # Set the electronic document to be posted and post immediately for synchronous formats. - res = super()._post(soft=soft) + posted = super()._post(soft=soft) edi_document_vals_list = [] - for move in self: + for move in posted: for edi_format in move.journal_id.edi_format_ids: is_edi_needed = move.is_invoice(include_receipts=False) and edi_format._is_required_for_invoice(move) @@ -152,8 +152,8 @@ class AccountMove(models.Model): }) self.env['account.edi.document'].create(edi_document_vals_list) - self.edi_document_ids._process_documents_no_web_services() - return res + posted.edi_document_ids._process_documents_no_web_services() + return posted def button_cancel(self): # OVERRIDE