bzr revid: fp@tinyerp.com-20081123112727-yd1xxf6qe34xgw0i
This commit is contained in:
Fabien Pinckaers 2008-11-23 12:27:27 +01:00
parent a2fddb8b40
commit e5b9ee5cf9
1 changed files with 12 additions and 1 deletions

View File

@ -229,7 +229,18 @@ class osv(orm.orm):
if hasattr(new, 'update'):
new.update(cls.__dict__.get(s, {}))
else:
new.extend(cls.__dict__.get(s, []))
if s=='_constraints':
for c in cls.__dict__.get(s, []):
exist = False
for c2 in range(len(new)):
if new[c2][2]==c[2]:
new[c2] = c
exist = True
break
if not exist:
new.append(c)
else:
new.extend(cls.__dict__.get(s, []))
nattr[s] = new
name = hasattr(cls, '_name') and cls._name or cls._inherit
cls = type(name, (cls, parent_class), nattr)