diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py index c2fe64f1c3..dd9dfc011b 100644 --- a/trytond/ir/translation.py +++ b/trytond/ir/translation.py @@ -747,7 +747,8 @@ class TranslationClean(Wizard): to_delete.append(translation.id) continue field = model_obj._columns[field_name] - if not hasattr(field, 'selection') or not field.selection: + if not hasattr(field, 'selection') or not field.selection \ + or not field.translate: to_delete.append(translation.id) continue if isinstance(field.selection, (tuple, list)) \ diff --git a/trytond/osv/fields.py b/trytond/osv/fields.py index 4af51e332b..0216b94da0 100644 --- a/trytond/osv/fields.py +++ b/trytond/osv/fields.py @@ -262,14 +262,15 @@ class Binary(Column): class Selection(Column): _type = 'selection' - def __init__(self, selections, string='unknown', sort=True, **args): + def __init__(self, selections, string='unknown', sort=True, translate=True, + **args): """ selections is a list of (key, string) or the name of the object function that return the list """ self.sort = sort Column.__init__(self, string=string, selection=selections, - **args) + translate=translate, **args) def sql_type(self): if self.size: diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index 2ea2d3aa86..4d8c35c80e 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -431,7 +431,8 @@ class ORM(object): 'WHERE id = %s ', (field.help, trans_help[trans_name]['id'])) if hasattr(field, 'selection') \ - and isinstance(field.selection, (tuple, list)): + and isinstance(field.selection, (tuple, list)) \ + and field.translate: for (key, val) in field.selection: if trans_name not in trans_selection \ or val not in trans_selection[trans_name]: @@ -1901,7 +1902,8 @@ class ORM(object): trans_args.append((self._name + ',' + field, 'help', context['language'], None)) if hasattr(self._columns[field], 'selection'): - if isinstance(self._columns[field].selection, (tuple, list)): + if isinstance(self._columns[field].selection, (tuple, list)) \ + and self._columns[field].translate: sel = self._columns[field].selection for (key, val) in sel: trans_args.append((self._name + ',' + field, @@ -1957,7 +1959,8 @@ class ORM(object): if hasattr(self._columns[field], 'selection'): if isinstance(self._columns[field].selection, (tuple, list)): sel = self._columns[field].selection - if context.get('language'): + if context.get('language') and \ + self._columns[field].translate: # translate each selection option sel2 = [] for (key, val) in sel: