Improve clean of model translation for field that are not more translated for
issue626
This commit is contained in:
1 parent
b499e8e16b
commit
9e043ef695
1 file changed
+9
-1
@@ -720,13 +720,21 @@ class TranslationClean(Wizard):
|
||||
continue
|
||||
elif translation.type == 'model':
|
||||
try:
|
||||
model_name, _ = translation.name.split(',', 1)
|
||||
model_name, field_name = translation.name.split(',', 1)
|
||||
except ValueError:
|
||||
to_delete.append(translation.id)
|
||||
continue
|
||||
if model_name not in self.pool.object_name_list():
|
||||
to_delete.append(translation.id)
|
||||
continue
|
||||
model_obj = self.pool.get(model_name)
|
||||
if field_name not in model_obj._columns:
|
||||
to_delete.append(translation.id)
|
||||
continue
|
||||
field = model_obj._columns[field_name]
|
||||
if not hasattr(field, 'translate') or not field.translate:
|
||||
to_delete.append(translation.id)
|
||||
continue
|
||||
elif translation.type == 'odt':
|
||||
if not report_obj.search(cursor, user, [
|
||||
('report_name', '=', translation.name),
|
||||
|
||||
Reference in new issue
Block a user