From aa65a46fc50701f2de59fadf382293621343ecbd Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 28 Dec 2017 15:16:18 +0100 Subject: [PATCH] [FIX] auth_signup, crm, project_timesheet_holidays, sales_team, website_sale: settings access error The new settings model loads by default all settings. In the case of non-admin user having the 'Settings' access rights this can lead to access errors. This commit deals with the multi-company issues on a standard installation. If the admin is in Company A and the other user in Company B, accessing the settings is pretty much impossible because of records rules. This fixes the master or demo data to avoid setting a company by default. Note that it only fixes a standard installation: if the settings are later customized, there is no guarantee that it will still work. Problematic fields: `auth_signup_template_user_id` `crm_default_team_id` `leave_timesheet_task_id` opw-801210 --- addons/auth_signup/views/res_config_settings_views.xml | 6 +----- addons/crm/data/crm_data.xml | 1 + addons/project_timesheet_holidays/models/res_company.py | 1 + addons/sales_team/data/sales_team_demo.xml | 2 ++ addons/website_sale/data/data.xml | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/auth_signup/views/res_config_settings_views.xml b/addons/auth_signup/views/res_config_settings_views.xml index 7027c2b0bad..0f4a5810ce8 100644 --- a/addons/auth_signup/views/res_config_settings_views.xml +++ b/addons/auth_signup/views/res_config_settings_views.xml @@ -19,11 +19,7 @@
-
- Copy access rights from -
-
+
diff --git a/addons/crm/data/crm_data.xml b/addons/crm/data/crm_data.xml index 5f1bfe35f86..cea07019442 100644 --- a/addons/crm/data/crm_data.xml +++ b/addons/crm/data/crm_data.xml @@ -6,6 +6,7 @@ True sales crm.opportunity.report + diff --git a/addons/project_timesheet_holidays/models/res_company.py b/addons/project_timesheet_holidays/models/res_company.py index 3cca96aff82..0eb9e4e3686 100644 --- a/addons/project_timesheet_holidays/models/res_company.py +++ b/addons/project_timesheet_holidays/models/res_company.py @@ -40,6 +40,7 @@ class Company(models.Model): 'name': _('Leaves'), 'project_id': company.leave_timesheet_project_id.id, 'active': False, + 'company_id': False, }) company.write({ 'leave_timesheet_task_id': task.id, diff --git a/addons/sales_team/data/sales_team_demo.xml b/addons/sales_team/data/sales_team_demo.xml index f9a6ff2c52d..91ea15a5470 100644 --- a/addons/sales_team/data/sales_team_demo.xml +++ b/addons/sales_team/data/sales_team_demo.xml @@ -5,6 +5,7 @@ Europe week + @@ -17,6 +18,7 @@ America week + diff --git a/addons/website_sale/data/data.xml b/addons/website_sale/data/data.xml index 910a5f95cfd..81639c17cd0 100644 --- a/addons/website_sale/data/data.xml +++ b/addons/website_sale/data/data.xml @@ -31,6 +31,7 @@ sale.report week +