From ee6e52fac75f277f675c12c0476127afa5439691 Mon Sep 17 00:00:00 2001
From: "Anup (OpenERP)" <ach@tinyerp.com>
Date: Tue, 11 May 2010 14:06:01 +0530
Subject: [PATCH] =?UTF-8?q?[FIX]=20=5Fconstraints=C2=A0:=C2=A0Multiple?=
 =?UTF-8?q?=C2=A0constraints=C2=A0on=C2=A0the=C2=A0same=C2=A0field=C2=A0sh?=
 =?UTF-8?q?ould=C2=A0be=C2=A0allowed?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

bzr revid: ach@tinyerp.com-20100511083601-ne9n2ftq5lbohvwg
---
 bin/osv/osv.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/osv/osv.py b/bin/osv/osv.py
index a528d418089c..08f62e50230d 100644
--- a/bin/osv/osv.py
+++ b/bin/osv/osv.py
@@ -253,7 +253,8 @@ class osv(osv_base, orm.orm):
                             for c in cls.__dict__.get(s, []):
                                 exist = False
                                 for c2 in range(len(new)):
-                                    if new[c2][2]==c[2]:
+                                     #For _constraints, we should check field and methods as well
+                                     if new[c2][2]==c[2] and new[c2][0]==c[0]:
                                         new[c2] = c
                                         exist = True
                                         break
-- 
GitLab