[FIX] ir_translation : corrected entry insertion when adding translation

lp bug: https://launchpad.net/bugs/385544 fixed

bzr revid: jvo@tinyerp.com-20090701075725-tysembj3bu81eari
This commit is contained in:
YSA,VRA
2009-07-01 13:27:25 +05:30
committed by Jay (Open ERP)
parent 5d52df70b4
commit dfafebf681
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -94,7 +94,7 @@ class ir_translation(osv.osv):
translations[res_id] = value
return translations
def _set_ids(self, cr, uid, name, tt, lang, ids, value):
def _set_ids(self, cr, uid, name, tt, lang, ids, value, src=None):
# clear the caches
tr = self._get_ids(cr, uid, name, tt, lang, ids)
for res_id in tr:
@@ -117,6 +117,7 @@ class ir_translation(osv.osv):
'name':name,
'res_id':id,
'value':value,
'src':src,
})
return len(ids)
+3 -2
View File
@@ -2291,11 +2291,12 @@ class orm(orm_template):
else:
cr.execute('update "'+self._table+'" set '+string.join(upd0, ',')+' ' \
'where id in ('+ids_str+')', upd1)
if totranslate:
for f in direct:
if self._columns[f].translate:
self.pool.get('ir.translation')._set_ids(cr, user, self._name+','+f, 'model', context['lang'], ids, vals[f])
src_trans = self.pool.get(self._name).read(cr,user,ids,[f])
self.pool.get('ir.translation')._set_ids(cr, user, self._name+','+f, 'model', context['lang'], ids, vals[f], src_trans[0][f])
# call the 'set' method of fields which are not classic_write
upd_todo.sort(lambda x, y: self._columns[x].priority-self._columns[y].priority)