[FIX] ir_translation: undo asymmetric change of set_ids/get_ids

Partial revert of commit 39d17c2580
of PR #4617, that broke translations by introducing a different
set of criterions for filtering translations in `_set_ids()` and
`_get_ids()`, adding the `module` column in `_set_ids`.

This meant `_get_ids` would see translations that `_set_ids`
would never update: the translation interface did not appear to
be working anymore as soon as a translation entry existed with
no `module` value.
This is likely for manual entries and for entries bootstrapped
by `translate_fields()`, as they do not belong to any module.

The situation described in PR #4617 probably requires an extra
fix in the translation import system instead.
This commit is contained in:
Olivier Dony 2015-08-05 15:00:06 +02:00
parent c525c6712a
commit 5a41a3011a
1 changed files with 1 additions and 4 deletions

View File

@ -286,7 +286,6 @@ class ir_translation(osv.osv):
def _set_ids(self, cr, uid, name, tt, lang, ids, value, src=None):
self._get_ids.clear_cache(self)
self.__get_source.clear_cache(self)
original_module = self.pool[name.split(',')[0]]._original_module
cr.execute('update ir_translation '
'set value=%s '
' , src=%s '
@ -294,10 +293,9 @@ class ir_translation(osv.osv):
'where lang=%s '
'and type=%s '
'and name=%s '
'and module=%s '
'and res_id IN %s '
'returning res_id',
(value,src,'translated',lang,tt,name,original_module,tuple(ids),))
(value,src,'translated',lang,tt,name,tuple(ids),))
existing_ids = [x[0] for x in cr.fetchall()]
@ -307,7 +305,6 @@ class ir_translation(osv.osv):
'type':tt,
'name':name,
'res_id':id,
'module':original_module,
'value':value,
'src':src,
'state':'translated'