diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 3352da495ad..dd8d65531c6 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -308,6 +308,8 @@ class AccountInvoice(models.Model): @api.model def create(self, vals): + if not vals.get('account_id',False): + raise UserError(_('Configuration error!\nCould not find any account to create the invoice, are you sure you have a chart of account installed?')) return super(AccountInvoice, self.with_context(mail_create_nolog=True)).create(vals) @api.model