[FIX] account: non-null quick_edit_total_amount on a journal entry
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) <wan@odoo.com> Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user