mirror of https://github.com/OCA/web.git
web_translate_dialog: Display only fields displayed in the view
parent.renderer.state.fields includes all the fields in the model whereas parent.renderer.state.getFieldNames() includes all the fields displayed in the view. This commit filters out fields that are not displayed in the view to avoid the TypeError "undefined is not an object (evaluating '$('[name='+field_name+']')[0].maxLength')" because translatable_fields did include fields that are not in the view.pull/1699/head
parent
27aa521220
commit
bf06a84b9a
|
@ -62,7 +62,7 @@ var TranslateDialog = Dialog.extend({
|
|||
get_translatable_fields: function(parent) {
|
||||
var field_list = [];
|
||||
_.each(parent.renderer.state.fields, function(field, name){
|
||||
if (field.translate == true){
|
||||
if (field.translate == true && parent.renderer.state.getFieldNames().includes(name)){
|
||||
field_list.push(name);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue