[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:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user