From 5163cf2e5c38be92b87b1988034f0ec1d4f4f60a Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Wed, 2 Apr 2014 10:56:31 +0200 Subject: [PATCH] Propagate the changes done in the translate dialog back to the view --- .../static/src/js/web_translate_dialog.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/web_translate_dialog/static/src/js/web_translate_dialog.js b/web_translate_dialog/static/src/js/web_translate_dialog.js index d539cf57..89c284c1 100644 --- a/web_translate_dialog/static/src/js/web_translate_dialog.js +++ b/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 }});