mirror of https://github.com/OCA/web.git
Propagate the changes done in the translate dialog back to the view
parent
91f8c43147
commit
5163cf2e5c
|
@ -186,17 +186,7 @@ openerp.web_translate_dialog = function (instance) {
|
|||
});
|
||||
_.each(translations, function(data, code) {
|
||||
if (code === self.view_language) {
|
||||
_.each(data, function(value, field) {
|
||||
var view_field = self.view.fields[field];
|
||||
var is_dirty = view_field.view.$el.hasClass('oe_form_dirty');
|
||||
// update the field on the view
|
||||
view_field.set_value(value);
|
||||
if ( !is_dirty ) {
|
||||
// Avoid to set the view dirty when not necessary:
|
||||
// values have already been saved.
|
||||
view_field.view.$el.removeClass('oe_form_dirty');
|
||||
}
|
||||
});
|
||||
self.view.set_values(data);
|
||||
}
|
||||
translation_mutex.exec(function() {
|
||||
return new instance.web.DataSet(self, self.view.dataset.model, self.view.dataset.get_context()).write(self.view.datarecord.id, data, { context : { 'lang': code }});
|
||||
|
|
Loading…
Reference in New Issue