This commit improves the ux in CRM by changing a few things:
- Restore the use_leads and use_quotations fields
along with their features as they were in 12.0.
- Hide the email alias if use_upportunities and use_leads
are unchecked.
- Show a link to the general settings instead of the alias_domain
if no alias_domain has been configured.
- fixes the "unassigned lead(s)" link so that
it redirects the user to the actually unassigned leads
Task: #1962182
PR: #32372
21 lines
994 B
Python
21 lines
994 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
from odoo import fields, models
|
|
|
|
|
|
class ResConfigSettings(models.TransientModel):
|
|
_inherit = 'res.config.settings'
|
|
|
|
def _get_crm_default_team_domain(self):
|
|
if not self.env.user.has_group('crm.group_use_lead'):
|
|
return [('use_opportunities', '=', True)]
|
|
return [('use_leads', '=', True)]
|
|
|
|
crm_default_team_id = fields.Many2one(
|
|
'crm.team', string='Default Sales Team', related='website_id.crm_default_team_id', readonly=False,
|
|
domain=lambda self: self._get_crm_default_team_domain(),
|
|
help='Default Sales Team for new leads created through the Contact Us form.')
|
|
crm_default_user_id = fields.Many2one(
|
|
'res.users', string='Default Salesperson', related='website_id.crm_default_user_id', domain=[('share', '=', False)], readonly=False,
|
|
help='Default salesperson for new leads created through the Contact Us form.')
|