From 8b4719a0d0e84c4f9caf9bef4b1d7a4eb24e11a5 Mon Sep 17 00:00:00 2001 From: Ricardo Gomes Rodrigues Date: Thu, 12 Oct 2023 15:57:09 +0200 Subject: [PATCH] [FIX] account: allow import of receipts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce: - Activate the receipts in the Accounting Settings - Go to Vendors -> Receipts - Upload a file -> Error "The journal in which to upload the invoice is not specified." opw-3544292 closes odoo/odoo#138612 X-original-commit: 00bad1954cd0bda21a7ec58f8ea8000a78e551ad Signed-off-by: William André (wan) Signed-off-by: Ricardo Gomes Rodrigues (rigr) --- addons/account/models/account_journal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 2488f3049e0..caf15423fd2 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -741,9 +741,9 @@ class AccountJournal(models.Model): self = self.env['account.journal'].browse(self._context.get("default_journal_id")) move_type = self._context.get("default_move_type", "entry") if not self: - if move_type in self.env['account.move'].get_sale_types(): + if move_type in self.env['account.move'].get_sale_types(include_receipts=True): journal_type = "sale" - elif move_type in self.env['account.move'].get_purchase_types(): + elif move_type in self.env['account.move'].get_purchase_types(include_receipts=True): journal_type = "purchase" else: raise UserError(_("The journal in which to upload the invoice is not specified. "))