mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user