From 1ff71cb9be638fbffaef51770e0397aa08882386 Mon Sep 17 00:00:00 2001 From: "Ricardo Gomes Rodrigues (rigr)" Date: Tue, 17 Jan 2023 12:15:00 +0000 Subject: [PATCH] [FIX] account: non-null quick_edit_total_amount on a journal entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some unsure reason, a client had a non-null quick_edit_total_amount on a journal entry which resulted in a traceback. The traceback appears because tax_totals is not defined for journal entries. However, the code should not have reached this statement. The first conditional statement of the method is not sufficient in such cases where the quick_edit_total_amount is not null, therefore we add another stronger condition on the quick_edit_mode too. The only possible way I could reproduce this was by using Studio: - Activate the Quick edit mode in Accounting - Studio - In the journal entry form view - Remove the invisibility and readonly conditions of quick_edit_amount_total - Fill in this quick amount - Traceback Ticket 3128200 closes odoo/odoo#110183 X-original-commit: 56e0a1e8fa5121408b0744531b5c5e5765c727aa Signed-off-by: William André (wan) Signed-off-by: Ricardo Gomes Rodrigues (rigr) --- 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 7de4485ba16..93adfb1fab7 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2547,7 +2547,7 @@ class AccountMove(models.Model): for that partner as the default one, otherwise the default of the journal. """ self.ensure_one() - if not self.quick_edit_total_amount: + if not self.quick_edit_mode or not self.quick_edit_total_amount: return False count, account_id, tax_ids = self._get_frequent_account_and_taxes( self.company_id.id,