From 0c3f58cb87b28c5c5cc4ec8c545eb0c8377ec610 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 6 Feb 2012 14:57:24 +0100 Subject: [PATCH] [FIX] account: invoice: add the journal and type in the constraints more flexible bzr revid: stw@openerp.com-20120206135724-e013l6jwwnf4b17q --- addons/account/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index f2e3e35e047..8f7c0fd65b5 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -289,7 +289,7 @@ class account_invoice(osv.osv): 'user_id': lambda s, cr, u, c: u, } _sql_constraints = [ - ('number_uniq', 'unique(number, company_id)', 'Invoice Number must be unique per Company!'), + ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), ] def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):