From e9cc9204d3d312ee28e26143341915fd8f4dc23c Mon Sep 17 00:00:00 2001 From: Antoine Boonen Date: Mon, 8 Apr 2024 11:19:31 +0200 Subject: [PATCH] [FIX] account: multiple pdf msg records creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure an email alias for the journal 'Vendor Bills' Send to the mail alias two pdf bills Issue: Only 1 record is created with the 2 bills as attachment The system should split the bills into separate records, but this does not occur: - after the first bill is processed the current move extract_state is 'waiting_extraction' - when the system check whether to extract data from the second document the result is negative as it check the state of the first document opw-3822262 Co-authored-by Andrea Grazioso closes odoo/odoo#160983 Related: odoo/enterprise#60168 Signed-off-by: William André (wan) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 331460ded4c..82177474d10 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3157,7 +3157,7 @@ class AccountMove(models.Model): close_file(file_data) continue - decoder = self._get_edi_decoder(file_data, new=new) + decoder = (current_invoice or current_invoice.new(self.default_get(['move_type', 'journal_id'])))._get_edi_decoder(file_data, new=new) if decoder: try: with self.env.cr.savepoint():