Skip to content

Commit

Permalink
Revert "Merge pull request #352 from StefanRijnhart/8.0-translations_…
Browse files Browse the repository at this point in the history
…fields_not_columns"

in favour of upstream (conflicting) fix in odoo@0c2f7bdbc

This reverts commit f8f27e0, reversing
changes made to 66210ee.
  • Loading branch information
OCA-git-bot committed Apr 28, 2016
1 parent 4016a35 commit 976d2d0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions openerp/tools/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,20 +746,18 @@ def get_root_view(xml_id):
_logger.error("name error in %s: %s", xml_name, str(exc))
continue
objmodel = registry.get(obj.model)
if (objmodel is None or (
field_name not in objmodel._columns and
field_name not in objmodel._fields)
if (objmodel is None or field_name not in objmodel._columns
or not objmodel._translate):
continue
field_def = objmodel._columns.get(field_name, objmodel._fields[field_name])
field_def = objmodel._columns[field_name]

name = "%s,%s" % (encode(obj.model), field_name)
push_translation(module, 'field', name, 0, encode(field_def.string))

if field_def.help:
push_translation(module, 'help', name, 0, encode(field_def.help))

if getattr(field_def, 'translate', None):
if field_def.translate:
ids = objmodel.search(cr, uid, [])
obj_values = objmodel.read(cr, uid, ids, [field_name])
for obj_value in obj_values:
Expand Down

0 comments on commit 976d2d0

Please sign in to comment.