mirror of https://github.com/OCA/web.git
Do not display readonly translatable fields in the translate dialog
parent
f27cba95ae
commit
c2174496cd
|
@ -43,7 +43,10 @@ openerp.web_translate_dialog = function (instance) {
|
|||
this.view_type = parent.fields_view.type || '';
|
||||
this.$view_form = null;
|
||||
this.$sidebar_form = null;
|
||||
this.translatable_fields_keys = _.map(this.view.translatable_fields || [], function(i) { return i.name;});
|
||||
this.translatable_fields = _.filter(this.view.translatable_fields || [],
|
||||
this.filter_translatable_fields);
|
||||
this.translatable_fields_keys = _.map(this.translatable_fields,
|
||||
function(i) { return i.name;});
|
||||
this.languages = null;
|
||||
this.languages_loaded = $.Deferred();
|
||||
(new instance.web.DataSetSearch(this,
|
||||
|
@ -53,6 +56,9 @@ openerp.web_translate_dialog = function (instance) {
|
|||
.read_slice(['code', 'name'], { sort: 'id' })
|
||||
.then(this.on_languages_loaded);
|
||||
},
|
||||
filter_translatable_fields: function(field) {
|
||||
return !field.field.readonly;
|
||||
},
|
||||
on_languages_loaded: function(langs) {
|
||||
this.languages = langs;
|
||||
this.languages_loaded.resolve();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div class="separator horizontal"><t t-esc="name"/></div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr t-foreach="widget.view.translatable_fields" t-as="field" t-att-data-field="field.name">
|
||||
<tr t-foreach="widget.translatable_fields" t-as="field" t-att-data-field="field.name">
|
||||
<td class="oe_form_frame_cell" width="1%" nowrap="nowrap">
|
||||
<label class="oe_label"><t t-esc="field.string"/>:</label>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue