Files
odoo_source/addons/crm/tests/common.py
T
Denis Vermylen (dve) eed8a34686 [IMP] crm_*, sale_*: sales channel dashboard
Functional
        ==========

Sales teams become sales channels. Their dashboard cards now include a graph
displaying customizable data for managers (comparable to those in accounting).

By default, you now have the following sales channels (non-demo):

      Direct Sales      (with installation of crm or sale)

  Sales Channel type: Sales
  Works same as before, what's changed is:
    - their cards display one big button directing to the start of their
      workflow
    - the links on the right-hand side have been reworked, and are only
      displayed when there is at least one item requiring attention.
    - 'More' tab remains unchanged.

      Website           (with installation of website_sale)

  Sales Channel type: Website
  Differences lies in the links displayed in the dashboard card:
    - it displays abandoned carts, awaiting payments and payments to capture
  Default Channel linked to all sales made from the eCommerce.

      Point of Sale     (with installation of sale and point_of_sale
                                              -> auto-installs pos_sale)

  Sales Channel type: Point of Sale
  Linked to pos.configs and their pos.sessions and pos.orders.
    - only links to their linked pos.config dashboard and open sessions
    - can't use opportunities, lead or invoicing and can only display
      pos.order data in the graph.
  Default Channel linked to the default pos.config.

        Technical
        =========

- Add a channel type: sales, pos, website that have different actions/settings
- Add a graphs to the kanban cards in the sales/crm dashboard, configurable in
  the form view in the new dashboard page.
- Rename sales teams to sales channels, rename and add default and demo sales
  channels
- Change dashboard links depending on the channel type and add a related
  computed fields on crm.team
- Rename strings and improve channel form view.
- Leads are now checked by default once activated for 'sales' type channels
- Disable checking "leads" without using "opportunities".
- Hide invoicing and invoicing target depending on channel type.
- Move currency_id to sales_team
2017-01-03 19:04:34 +01:00

53 lines
2.0 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
from odoo.addons.mail.tests.common import TestMail
class TestCrm(TestMail):
@classmethod
def setUpClass(cls):
super(TestCrm, cls).setUpClass()
user_group_employee = cls.env.ref('base.group_user')
user_group_salesman_all = cls.env.ref('sales_team.group_sale_salesman_all_leads')
# Test users to use through the various tests
Users = cls.env['res.users'].with_context({'no_reset_password': True, 'mail_create_nosubscribe': True})
cls.user_salesman_all = Users.create({
'name': 'Riton La Chignole',
'login': 'riton',
'email': 'riton.salesman_all@example.com',
'groups_id': [(6, 0, [user_group_employee.id, user_group_salesman_all.id])]
})
cls.sales_team_1 = cls.env['crm.team'].create({
'name': 'Test Sales Channel',
'alias_name': 'test_sales_team',
})
class TestCrmCases(TransactionCase):
def setUp(self):
super(TestCrmCases, self).setUp()
# Create a user as 'Crm Salesmanager' and added the `sales manager` group
self.crm_salemanager = self.env['res.users'].create({
'company_id': self.env.ref("base.main_company").id,
'name': "Crm Sales manager",
'login': "csm",
'email': "crmmanager@yourcompany.com",
'groups_id': [(6, 0, [self.ref('sales_team.group_sale_manager')])]
})
# Create a user as 'Crm Salesman' and added few groups
self.crm_salesman = self.env['res.users'].create({
'company_id': self.env.ref("base.main_company").id,
'name': "Crm Salesman",
'login': "csu",
'email': "crmuser@yourcompany.com",
'groups_id': [(6, 0, [self.env.ref('sales_team.group_sale_salesman_all_leads').id, self.env.ref('base.group_partner_manager').id])]
})