mirror of https://github.com/OCA/web.git
[FIX] avoid to set the dirty flag on the view when not necessary, especially when the translate dialog is opened from the readonly view.
parent
f57bb2a855
commit
d0c7449560
|
@ -179,7 +179,15 @@ openerp.web_translate_dialog = function (instance) {
|
||||||
_.each(trads, function(data, code) {
|
_.each(trads, function(data, code) {
|
||||||
if (code === self.view_language) {
|
if (code === self.view_language) {
|
||||||
_.each(data, function(value, field) {
|
_.each(data, function(value, field) {
|
||||||
self.view.fields[field].set_value(value);
|
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');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
trads_mutex.exec(function() {
|
trads_mutex.exec(function() {
|
||||||
|
|
Loading…
Reference in New Issue