[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:
@@ -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. "))
|
||||
|
||||
Reference in New Issue
Block a user