[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:
Martin Trigaux 2016-06-08 10:57:21 +02:00
parent fe99c51703
commit f307e36e66
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 4 additions and 2 deletions

View File

@ -363,9 +363,11 @@ openerp.base_import = function (instance) {
var fields = this.$('.oe_import_fields input.oe_import_match_field').map(function (index, el) {
return $(el).select2('val') || false;
}).get();
var tracking_disable = 'tracking_disable' in kwargs ? kwargs.tracking_disable : !this.$('#oe_import_tracking').prop('checked')
delete kwargs.tracking_disable
kwargs.context = _.extend(
{}, 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)
.then(undefined, function (error, event) {
@ -381,7 +383,7 @@ openerp.base_import = function (instance) {
}) ;
},
onvalidate: function () {
return this.call_import({ dryrun: true })
return this.call_import({ dryrun: true, tracking_disable: true })
.done(this.proxy('validated'));
},
onimport: function () {