[FIX] account_invoice: raise exception in case we try to create an account invoice with no account_id (probably no CoA installed)

This commit is contained in:
Cedric Snauwaert
2015-05-12 15:19:24 +02:00
committed by Cédric Snauwaert
parent 6e1f2463a6
commit 7c8a46be2c
+2
View File
@@ -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