diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 0f2cf267b47..cd460cf35d9 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -30,6 +30,7 @@ access_res_partner,res.partner.crm.user,base.model_res_partner,base.group_sale_s 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 +mail_mail_message,mail.message,mail.model_mail_message,base.group_sale_manager,1,1,1,1 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/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index edaf844952a..ae2b6294c68 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -1,10 +1,13 @@ - - I cancel unqualified lead. + Salesman cancel unqualified lead. +- + !context + uid: 'crm_res_users_salesman' - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_1")]) - - I check cancelled lead. + Salesman check cancelled lead. - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_1')) @@ -12,34 +15,34 @@ assert lead.state == 'cancel', "Opportunity is not in 'cancel' state." assert lead.probability == 0.0, 'Opportunity is probably wrong and should be 0.0.' - - I reset cancelled lead into unqualified lead. + Salesman reset cancelled lead into unqualified lead. - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_1")]) - - I check unqualified lead after reset. + Salesman check unqualified lead after reset. - !assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in draft state}: - state == "draft" - - I re-open the lead + Salesman re-open the lead - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_case_1")]) - - I check stage and state of the re-opened lead + Salesman check stage and state of the re-opened lead - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm.crm_case_1')) assert lead.stage_id.id == ref('crm.stage_lead2'), "Opportunity stage should be 'Qualification'." assert lead.state == 'open', "Opportunity should be in 'open' state." - - I escalate the lead to parent team. + Salesman escalate the lead to parent team. - !python {model: crm.lead}: | self.case_escalate(cr, uid, [ref("crm_case_1")]) - - I check the lead is correctly escalated to the parent team. + Salesman check the lead is correctly escalated to the parent team. - !assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}: - section_id.name == "Support Department" diff --git a/addons/crm/test/process/communication_with_customer.yml b/addons/crm/test/process/communication_with_customer.yml index 221a4ab634f..4a36aeebd02 100644 --- a/addons/crm/test/process/communication_with_customer.yml +++ b/addons/crm/test/process/communication_with_customer.yml @@ -1,3 +1,8 @@ +- + Salesman communication with customer. +- + !context + uid: 'crm_res_users_salesman' - Customer interested in our product, so he sends request by email to get more details. - diff --git a/addons/crm/test/process/lead2opportunity2win.yml b/addons/crm/test/process/lead2opportunity2win.yml index fc56b513588..c69eb09ac31 100644 --- a/addons/crm/test/process/lead2opportunity2win.yml +++ b/addons/crm/test/process/lead2opportunity2win.yml @@ -1,5 +1,5 @@ - - Now, check the data with Salesman. + Salesman convert the lead into opportunity. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml index 0d823dc87f4..9583c6034bf 100644 --- a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml +++ b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml @@ -1,5 +1,5 @@ - - 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). + During a lead to opp conversion, salesmen should be assigned to leads following the round-robin method. Start by creating 4 salesmen (A to D) and 6 leads (1 to 6). - !record {model: res.users, id: test_res_user_01}: name: 'Test user A' @@ -21,7 +21,7 @@ login: 'tud' new_password: 'tud' - - Now, check the data with Salesman. + Salesman creates lead. - !context uid: 'crm_res_users_salesman' @@ -62,7 +62,7 @@ partner_name: 'Agrolait SuperSeed SA' stage_id: stage_lead1 - - I create a mass convert wizard and convert all the leads. + Salesman create a mass convert wizard and convert all the leads. - !python {model: crm.lead2opportunity.partner.mass}: | context.update({'active_model': 'crm.lead', 'active_ids': [ref("test_crm_lead_01"), ref("test_crm_lead_02"), ref("test_crm_lead_03"), ref("test_crm_lead_04"), ref("test_crm_lead_05"), ref("test_crm_lead_06")], 'active_id': ref("test_crm_lead_01")}) diff --git a/addons/crm/test/ui/crm_demo.yml b/addons/crm/test/ui/crm_demo.yml index 9154ffdf513..85ed1cf7403 100644 --- a/addons/crm/test/ui/crm_demo.yml +++ b/addons/crm/test/ui/crm_demo.yml @@ -1,5 +1,9 @@ + - - I create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method. + Sales manager create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method. +- + !context + uid: 'crm_res_users_salesmanager' - !record {model: crm.lead, id: crm_case_25}: name: 'Need more info about your pc2' @@ -8,7 +12,7 @@ stage_id: crm.stage_lead1 state: draft - - I create a lead record to call a mailing opt-out onchange method. + Sales manager create a lead record to call a mailing opt-out onchange method. - !record {model: crm.lead, id: crm_case_18}: name: 'Need 20 Days of Consultancy' @@ -16,13 +20,13 @@ state: draft opt_out: True - - I create a phonecall record to call a partner onchange method. + Sales manager create a phonecall record to call a partner onchange method. - !record {model: crm.phonecall, id: crm_phonecall_5}: name: 'Bad time' partner_id: base.res_partner_5 - - I set the next stage to "New" for the lead. + Sales manager set the next stage to "New" for the lead. - !python {model: crm.lead}: | self.stage_next(cr, uid, [ref("crm_case_4")], context={'stage_type': 'lead'}) diff --git a/addons/crm/test/ui/delete_lead.yml b/addons/crm/test/ui/delete_lead.yml index 49713039f22..f68061ba6cd 100644 --- a/addons/crm/test/ui/delete_lead.yml +++ b/addons/crm/test/ui/delete_lead.yml @@ -1,5 +1,10 @@ - - I Unlink the Lead. + Sales manager can delete lead. +- + !context + uid: 'crm_res_users_salesmanager' +- + Sales manager Unlink the Lead. - !python {model: crm.lead}: | self.unlink(cr, uid, [ref("crm_case_4")]) diff --git a/addons/mail/security/ir.model.access.csv b/addons/mail/security/ir.model.access.csv index 8faa06b0aa5..81b2356938b 100644 --- a/addons/mail/security/ir.model.access.csv +++ b/addons/mail/security/ir.model.access.csv @@ -1,7 +1,7 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_mail_message_all,mail.message.all,model_mail_message,,1,0,0,0 access_mail_message_user,mail.message.user,model_mail_message,base.group_user,1,1,1,1 -access_mail_mail_all,mail.mail.all,model_mail_mail,,1,0,0,0 +access_mail_mail_all,mail.mail.all,model_mail_mail,,1,0,1,0 access_mail_mail_user,mail.mail.user,model_mail_mail,base.group_user,1,1,1,0 access_mail_mail_system,mail.mail.system,model_mail_mail,base.group_system,1,1,1,1 access_mail_followers_all,mail.followers.all,model_mail_followers,,1,0,0,0