[FIX] base_import: disable tracking during validation
Force the value tracking_disable to be make sure that the validation (which is supposed to have no impact), will not send any email. Fixes #3173
This commit is contained in:
parent
fe99c51703
commit
f307e36e66
|
@ -363,9 +363,11 @@ openerp.base_import = function (instance) {
|
||||||
var fields = this.$('.oe_import_fields input.oe_import_match_field').map(function (index, el) {
|
var fields = this.$('.oe_import_fields input.oe_import_match_field').map(function (index, el) {
|
||||||
return $(el).select2('val') || false;
|
return $(el).select2('val') || false;
|
||||||
}).get();
|
}).get();
|
||||||
|
var tracking_disable = 'tracking_disable' in kwargs ? kwargs.tracking_disable : !this.$('#oe_import_tracking').prop('checked')
|
||||||
|
delete kwargs.tracking_disable
|
||||||
kwargs.context = _.extend(
|
kwargs.context = _.extend(
|
||||||
{}, this.parent_context,
|
{}, this.parent_context,
|
||||||
{tracking_disable: !this.$('#oe_import_tracking').prop('checked')}
|
{tracking_disable: tracking_disable}
|
||||||
);
|
);
|
||||||
return this.Import.call('do', [this.id, fields, this.import_options()], kwargs)
|
return this.Import.call('do', [this.id, fields, this.import_options()], kwargs)
|
||||||
.then(undefined, function (error, event) {
|
.then(undefined, function (error, event) {
|
||||||
|
@ -381,7 +383,7 @@ openerp.base_import = function (instance) {
|
||||||
}) ;
|
}) ;
|
||||||
},
|
},
|
||||||
onvalidate: function () {
|
onvalidate: function () {
|
||||||
return this.call_import({ dryrun: true })
|
return this.call_import({ dryrun: true, tracking_disable: true })
|
||||||
.done(this.proxy('validated'));
|
.done(this.proxy('validated'));
|
||||||
},
|
},
|
||||||
onimport: function () {
|
onimport: function () {
|
||||||
|
|
Loading…
Reference in New Issue