[FIX] account: allow import of receipts

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) <wan@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
This commit is contained in:
Ricardo Gomes Rodrigues
2023-10-13 11:46:29 +00:00
parent c5f92537fc
commit 8b4719a0d0
+2 -2
View File
@@ -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. "))