[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 <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
oco-odoo
2020-11-30 15:26:27 +00:00
parent 5cfc62cb33
commit 89971a5ba5
+2 -3
View File
@@ -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