[FIX] website: Impossible to link an analytic account

Steps to reproduce the bug:

- Go to Website > Dashboard > Analytics and click on "Link my analytics account"
- Enter some data and save

Bug:

A traceback was raised: TypeError: website_set_ga_data() missing 1 required
positional argument: 'website_id'

opw:1905874

closes odoo/odoo#28636
This commit is contained in:
Goffin Simon
2018-11-13 16:12:47 +00:00
parent 40b4584b00
commit 51982f9199
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -61,6 +61,6 @@ class WebsiteBackend(http.Controller):
request.env['res.config.settings'].create({
'google_management_client_id': ga_client_id,
'google_analytics_key': ga_analytics_key,
'website_id': current_website,
'website_id': current_website.id,
}).execute()
return True
@@ -44,6 +44,9 @@ var Dashboard = AbstractAction.extend(ControlPanelMixin, {
var self = this;
return $.when(ajax.loadLibs(this), this._super()).then(function() {
return self.fetch_data();
}).then(function(){
var website = _.findWhere(self.websites, {selected: true});
self.website_id = website ? website.id : false;
});
},