Browse Source

Propagate the changes done in the translate dialog back to the view

pull/4/head
Guewen Baconnier 11 years ago
parent
commit
1fd034fd59
  1. 12
      web_translate_dialog/static/src/js/web_translate_dialog.js

12
web_translate_dialog/static/src/js/web_translate_dialog.js

@ -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…
Cancel
Save