From 9a20018166d0633c6b3cee2f13ec5c65c215df60 Mon Sep 17 00:00:00 2001 From: Hardik Ansodariya Date: Wed, 23 Jul 2014 10:03:40 +0200 Subject: [PATCH] [FIX] stock: allow same serial number for different products Bug lp:1222289, opw 597639 --- 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 3b1e70646f1..c14819f9f5f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1487,7 +1487,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)', 'The combination of Serial Number and internal reference must be unique !'), + ('name_ref_uniq', 'unique (name, ref, product_id, company_id)', 'The combination of Serial Number, internal reference, Product and Company must be unique !'), ] def action_traceability(self, cr, uid, ids, context=None): """ It traces the information of a product