From 3883ffbba78ea02ca61f43e0a36bcc198fe9cfbf Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 2 Mar 2015 14:34:29 +0100 Subject: [PATCH] [IMP] Production lot unique sql constraint should only depend on name and product, as NULL values in the reference make everything possible --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d2a5265ef13..ddfde0a3f75 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1583,7 +1583,7 @@ class stock_production_lot(osv.osv): 'product_id': lambda x, y, z, c: c.get('product_id', False), } _sql_constraints = [ - ('name_ref_uniq', 'unique (name, ref, product_id)', 'The combination of serial number, internal reference and product must be unique !'), + ('name_ref_uniq', 'unique (name, product_id)', 'The combination of serial number and product must be unique !'), ] def action_traceability(self, cr, uid, ids, context=None):