From 241c758bbca28c7dfa5e39369366e0b82d289ddb Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 22 Mar 2021 10:50:09 +0000 Subject: [PATCH] [FIX] account_edi: disable prediction when importing invoices. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes odoo/odoo#69177 X-original-commit: 1502612c5d7f7516091e7e9dd2dba47cb0fccf25 Related: odoo/enterprise#17605 Signed-off-by: William André (wan) --- addons/account_edi_facturx/models/account_edi_format.py | 3 ++- addons/l10n_it_edi/models/account_edi_format.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account_edi_facturx/models/account_edi_format.py b/addons/account_edi_facturx/models/account_edi_format.py index ce5403b8c50..3a487e0e691 100644 --- a/addons/account_edi_facturx/models/account_edi_format.py +++ b/addons/account_edi_facturx/models/account_edi_format.py @@ -136,7 +136,8 @@ class AccountEdiFormat(models.Model): invoice.move_type = default_move_type # self could be a single record (editing) or be empty (new). - with Form(invoice.with_context(default_move_type=default_move_type)) as invoice_form: + with Form(invoice.with_context(default_move_type=default_move_type, + account_predictive_bills_disable_prediction=True)) as invoice_form: partner_type = invoice_form.journal_id.type == 'purchase' and 'SellerTradeParty' or 'BuyerTradeParty' invoice_form.partner_id = self._retrieve_partner( name=_find_value('//ram:' + partner_type + '/ram:Name'), diff --git a/addons/l10n_it_edi/models/account_edi_format.py b/addons/l10n_it_edi/models/account_edi_format.py index bc03dce1bb3..6fccb89c706 100644 --- a/addons/l10n_it_edi/models/account_edi_format.py +++ b/addons/l10n_it_edi/models/account_edi_format.py @@ -152,7 +152,8 @@ class AccountEdiFormat(models.Model): elif elements and elements[0].text and elements[0].text == 'TD04': move_type = 'in_refund' # move could be a single record (editing) or be empty (new). - with Form(invoice.with_context(default_move_type=move_type)) as invoice_form: + with Form(invoice.with_context(default_move_type=move_type, + account_predictive_bills_disable_prediction=True)) as invoice_form: message_to_log = [] # Partner (first step to avoid warning 'Warning! You must first select a partner.'). <1.2>