diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 0dd075d48e6..1d0ea32c0bc 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -103,6 +103,7 @@ Dashboard for CRM will include: 'crm_action_rule_demo.xml', ], 'test': [ + 'test/ui/crm_access_group_users.yml', 'test/process/communication_with_customer.yml', 'test/process/lead2opportunity2win.yml', 'test/process/lead2opportunity_assign_salesmen.yml', diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 74394d3c5ce..0f2cf267b47 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -29,6 +29,7 @@ access_calendar_attendee_crm_manager,calendar.attendee.crm.manager,model_calenda access_res_partner,res.partner.crm.user,base.model_res_partner,base.group_sale_salesman,1,1,1,0 access_res_partner_category,res.partner.category.crm.user,base.model_res_partner_category,base.group_sale_salesman,1,1,1,0 mail_mailgate_thread,mail.thread,mail.model_mail_thread,base.group_sale_salesman,1,1,1,1 +access_mail_message,mail.message,mail.model_mail_message,base.group_sale_salesman,1,1,1,0 access_crm_case_categ_manager,crm.case.categ manager,model_crm_case_categ,base.group_sale_manager,1,1,1,1 access_base_action_rule_manager,base.action.rule manager,base_action_rule.model_base_action_rule,base.group_sale_manager,1,1,1,1 access_crm_lead_report_user,crm.lead.report user,model_crm_lead_report,base.group_sale_salesman,1,1,1,1 diff --git a/addons/crm/test/process/lead2opportunity2win.yml b/addons/crm/test/process/lead2opportunity2win.yml index 94e7149ef77..fc56b513588 100644 --- a/addons/crm/test/process/lead2opportunity2win.yml +++ b/addons/crm/test/process/lead2opportunity2win.yml @@ -1,3 +1,8 @@ +- + Now, check the data with Salesman. +- + !context + uid: 'crm_res_users_salesman' - In order to test the conversion of a lead into a opportunity, - diff --git a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml index 0edd3b8edce..0d823dc87f4 100644 --- a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml +++ b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml @@ -1,5 +1,30 @@ - During a lead to opp conversion, salesmen should be assigned to leads following the round-robin method. Start by creating 6 leads (1 to 6) and 4 salesmen (A to D). +- + !record {model: res.users, id: test_res_user_01}: + name: 'Test user A' + login: 'tua' + new_password: 'tua' +- + !record {model: res.users, id: test_res_user_02}: + name: 'Test user B' + login: 'tub' + new_password: 'tub' +- + !record {model: res.users, id: test_res_user_03}: + name: 'Test user C' + login: 'tuc' + new_password: 'tuc' +- + !record {model: res.users, id: test_res_user_04}: + name: 'Test user D' + login: 'tud' + new_password: 'tud' +- + Now, check the data with Salesman. +- + !context + uid: 'crm_res_users_salesman' - !record {model: crm.lead, id: test_crm_lead_01}: type: 'lead' @@ -36,26 +61,6 @@ name: 'Test lead 6' partner_name: 'Agrolait SuperSeed SA' stage_id: stage_lead1 -- - !record {model: res.users, id: test_res_user_01}: - name: 'Test user A' - login: 'tua' - new_password: 'tua' -- - !record {model: res.users, id: test_res_user_02}: - name: 'Test user B' - login: 'tub' - new_password: 'tub' -- - !record {model: res.users, id: test_res_user_03}: - name: 'Test user C' - login: 'tuc' - new_password: 'tuc' -- - !record {model: res.users, id: test_res_user_04}: - name: 'Test user D' - login: 'tud' - new_password: 'tud' - I create a mass convert wizard and convert all the leads. - diff --git a/addons/crm/test/process/merge_opportunity.yml b/addons/crm/test/process/merge_opportunity.yml index c50af5214e6..e9027e228d7 100644 --- a/addons/crm/test/process/merge_opportunity.yml +++ b/addons/crm/test/process/merge_opportunity.yml @@ -1,4 +1,3 @@ - - During a mixed merge (involving leads and opps), data should be handled a certain way following their type (m2o, m2m, text, ...) Start by creating two leads and an opp. - diff --git a/addons/crm/test/process/phonecalls.yml b/addons/crm/test/process/phonecalls.yml index 51a933f3223..a71bfc05e03 100644 --- a/addons/crm/test/process/phonecalls.yml +++ b/addons/crm/test/process/phonecalls.yml @@ -1,3 +1,8 @@ +- + Now, check the data with Salesman. +- + !context + uid: 'crm_res_users_salesman' - I schedule a phone call with a customer. - diff --git a/addons/crm/test/ui/crm_access_group_users.yml b/addons/crm/test/ui/crm_access_group_users.yml new file mode 100644 index 00000000000..194c202ef15 --- /dev/null +++ b/addons/crm/test/ui/crm_access_group_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Salesmanager' +- + !record {model: res.users, id: crm_res_users_salesmanager}: + company_id: base.main_company + name: Sales manager + login: csm + password: csm + groups_id: + - base.group_sale_manager +- + Create a user as 'Salesman' +- + !record {model: res.users, id: crm_res_users_salesman}: + company_id: base.main_company + name: Salesman + login: csu + password: csu + groups_id: + - base.group_sale_salesman_all_leads diff --git a/addons/mail/security/ir.model.access.csv b/addons/mail/security/ir.model.access.csv index 1141a3f928d..8faa06b0aa5 100644 --- a/addons/mail/security/ir.model.access.csv +++ b/addons/mail/security/ir.model.access.csv @@ -7,12 +7,12 @@ access_mail_mail_system,mail.mail.system,model_mail_mail,base.group_system,1,1,1 access_mail_followers_all,mail.followers.all,model_mail_followers,,1,0,0,0 access_mail_followers_user,mail.followers.user,model_mail_followers,base.group_user,1,1,0,0 access_mail_followers_system,mail.followers.system,model_mail_followers,base.group_system,1,1,1,1 -access_mail_notification_all,mail.notification.all,model_mail_notification,,1,0,0,0 +access_mail_notification_all,mail.notification.all,model_mail_notification,,1,0,1,0 access_mail_notification_user,mail.notification.user,model_mail_notification,base.group_user,1,1,1,0 access_mail_notification_system,mail.notification.system,model_mail_notification,base.group_system,1,1,1,1 access_mail_group_all,mail.group.all,model_mail_group,,1,0,0,0 access_mail_group_user,mail.group.user,model_mail_group,base.group_user,1,1,1,1 -access_mail_alias_all,mail.alias.all,model_mail_alias,,1,0,0,0 +access_mail_alias_all,mail.alias.all,model_mail_alias,,1,0,1,0 access_mail_alias_user,mail.alias.user,model_mail_alias,base.group_user,1,1,1,0 access_mail_alias_system,mail.alias.system,model_mail_alias,base.group_system,1,1,1,1 access_mail_message_subtype_all,mail.message.subtype.all,model_mail_message_subtype,,1,0,0,0