[FIX] ir_model_data : SQL_Constraint failure covered
lp bug: https://launchpad.net/bugs/393858 fixed bzr revid: jvo@tinyerp.com-20090731141115-wz5jg07ow5cdqj0z
This commit is contained in:
committed by
Jay (Open ERP)
parent
c7cc86b376
commit
b2ff940786
+5
-1
@@ -381,8 +381,12 @@ class orm_template(object):
|
||||
vals['select_level']
|
||||
))
|
||||
if 'module' in context:
|
||||
name1 = 'field_' + self._table + '_' + k
|
||||
cr.execute("select name from ir_model_data where name='%s'"%(name1))
|
||||
if cr.fetchone():
|
||||
name1 = name1 + "_" + str(id)
|
||||
cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \
|
||||
(('field_'+self._table+'_'+k)[:64], context['module'], 'ir.model.fields', id)
|
||||
(name1[:64], context['module'], 'ir.model.fields', id)
|
||||
)
|
||||
else:
|
||||
for key, val in vals.items():
|
||||
|
||||
Reference in New Issue
Block a user