From 89971a5ba5151036887a1dba15feba7d658f35b9 Mon Sep 17 00:00:00 2001 From: oco-odoo Date: Mon, 30 Nov 2020 13:49:29 +0000 Subject: [PATCH] [FIX] account: allow setting taxes on a miscellaneous journal entry https://github.com/odoo/odoo/commit/1b273d4c11e3e8d8583de302b71b2522a71f4d1d added the 'general' value to invoice_filter_type_domain, neglecting that this field was used for filtering tax_ids field of account.move.line, and hence making it impossible to select any tax in that field when creating a misc. operation manually. This commit does what the initial fix intended without breaking the taxes. closes odoo/odoo#62628 X-original-commit: fad10e505f8e2f0d64c97460144afe1be0ba808d Signed-off-by: Laurent Smet Signed-off-by: oco-odoo --- addons/account/models/account_move.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index ef26f9594f5..44e4ebcf107 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1035,7 +1035,8 @@ class AccountMove(models.Model): @api.depends('company_id', 'invoice_filter_type_domain') def _compute_suitable_journal_ids(self): for m in self: - domain = [('company_id', '=', m.company_id.id), ('type', '=?', m.invoice_filter_type_domain)] + journal_type = m.invoice_filter_type_domain or 'general' + domain = [('company_id', '=', m.company_id.id), ('type', '=', journal_type)] m.suitable_journal_ids = self.env['account.journal'].search(domain) @api.depends('posted_before', 'state', 'journal_id', 'date') @@ -1172,8 +1173,6 @@ class AccountMove(models.Model): move.invoice_filter_type_domain = 'sale' elif move.is_purchase_document(include_receipts=True): move.invoice_filter_type_domain = 'purchase' - elif move.move_type == 'entry': - move.invoice_filter_type_domain = 'general' else: move.invoice_filter_type_domain = False