From d716b53883ac998cf1d40187ea07779839c3db7f Mon Sep 17 00:00:00 2001 From: qmo-odoo Date: Fri, 2 Aug 2019 07:56:02 +0000 Subject: [PATCH] [REF] website_links: set is_website to True on the campaign PURPOSE This commit removes the mass_mailing.campaign model. Instead of having a fully fledged model, we will simply inherit utm.campaign. We will also add relevant statistics on utm campaign model in order to use it in various applications. SPECIFICATIONS This commit changes website_links.js so that, when creating a campaign, the field is_website is set to true. This will allow us to filter irrelevant campaigns in mass_mailing and social Task ID: 2002029 PR: #34015 --- addons/website_links/static/src/js/website_links.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/website_links/static/src/js/website_links.js b/addons/website_links/static/src/js/website_links.js index 7ebb60c0c2c..91b7177ea6b 100644 --- a/addons/website_links/static/src/js/website_links.js +++ b/addons/website_links/static/src/js/website_links.js @@ -77,10 +77,16 @@ var SelectBox = publicWidget.Widget.extend({ */ _createObject: function (name) { var self = this; + var args = { + name: name + }; + if (this.obj === "utm.campaign"){ + args.is_website = true; + } return this._rpc({ model: this.obj, method: 'create', - args: [{name: name}], + args: [args], }).then(function (record) { self.$el.attr('value', record); self.objects.push({'id': record, 'text': name});