From dda65902c200fff62f36823b26ddf045bf8947d1 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Mon, 27 Jul 2020 14:12:12 +0000 Subject: [PATCH] [FIX] account: fix send sample invoice With company country and localization set to Peru Go to invoice dashboard Click on 'Send sample' User will receive the warning 'If you want to use "Off-Balance Sheet" accounts, all the accounts of the journal entry must be of this type' and the action will abort because the first account fetched for the operation is an 'Off Balance' account opw-2300813 closes odoo/odoo#55509 X-original-commit: 27a9eb3083e7938199ff047060135e030496eec0 Signed-off-by: Simon Goffin (sig) Signed-off-by: agr-odoo --- addons/account/models/company.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/models/company.py b/addons/account/models/company.py index d71c0962875..d3e3ce03f30 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -428,6 +428,7 @@ class ResCompany(models.Model): "\nPlease go to Configuration > Journals.") raise RedirectWarning(msg, action.id, _("Go to the journal configuration")) + account = journal.default_credit_account_id or account sample_invoice = self.env['account.move'].with_context(default_move_type='out_invoice', default_journal_id=journal.id).create({ 'payment_reference': _('Sample invoice'), 'partner_id': partner.id,