[FIX] l10n_multilang: remove force_write attribute in process_translations
authorMartin Trigaux <mat@openerp.com>
Wed, 30 Oct 2013 11:13:03 +0000 (12:13 +0100)
committerMartin Trigaux <mat@openerp.com>
Wed, 30 Oct 2013 11:13:03 +0000 (12:13 +0100)
When processing a translation, the module used to replace the original term by the translated value for accounts (only object with force_write=True).
This lead to only having the translated version for every user, independent of user's language.
On new chart of accounts, will have different account names according to the user preference.
Keep argument force_write in API for stability reason (will be removed in trunk)

bzr revid: mat@openerp.com-20131030111303-ziusplk330oj9wf4

addons/l10n_multilang/l10n_multilang.py

index 9596b29..a44c9f8 100644 (file)
@@ -65,20 +65,15 @@ class wizard_multi_charts_accounts(osv.osv_memory):
             for j in range(len(in_ids)):
                 in_id = in_ids[j]
                 if value[in_id]:
-                    if not force_write:
-                        #copy Translation from Source to Destination object
-                        xlat_obj.create(cr, uid, {
-                          'name': out_obj._name + ',' + in_field,
-                          'type': 'model',
-                          'res_id': out_ids[j],
-                          'lang': lang,
-                          'src': src[in_id],
-                          'value': value[in_id],
+                    #copy Translation from Source to Destination object
+                    xlat_obj.create(cr, uid, {
+                        'name': out_obj._name + ',' + in_field,
+                        'type': 'model',
+                        'res_id': out_ids[j],
+                        'lang': lang,
+                        'src': src[in_id],
+                        'value': value[in_id],
                     })
-                    else:
-                        #replace the value in the destination object only if it's the user lang
-                        if context.get('lang') == lang:
-                            self.pool.get(out_obj._name).write(cr, uid, out_ids[j], {in_field: value[in_id]})
                 else:
                     _logger.info('Language: %s. Translation from template: there is no translation available for %s!' %(lang,  src[in_id]))#out_obj._name))
         return True