|
@ -186,17 +186,7 @@ openerp.web_translate_dialog = function (instance) { |
|
|
}); |
|
|
}); |
|
|
_.each(translations, function(data, code) { |
|
|
_.each(translations, function(data, code) { |
|
|
if (code === self.view_language) { |
|
|
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() { |
|
|
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 }}); |
|
|
return new instance.web.DataSet(self, self.view.dataset.model, self.view.dataset.get_context()).write(self.view.datarecord.id, data, { context : { 'lang': code }}); |
|
|