[FIX] account: invoice: add the journal and type in the constraints more flexible
authorStephane Wirtel <stw@openerp.com>
Mon, 6 Feb 2012 13:57:24 +0000 (14:57 +0100)
committerStephane Wirtel <stw@openerp.com>
Mon, 6 Feb 2012 13:57:24 +0000 (14:57 +0100)
bzr revid: stw@openerp.com-20120206135724-e013l6jwwnf4b17q

addons/account/account_invoice.py

index f2e3e35..8f7c0fd 100644 (file)
@@ -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):