PURPOSE Perform a global renaming / cleaning of IAP features often added or merged with minimal review. Time to cleanup ! SPECIFICATIONS Reorganize module according to guidelines. Notably correctly name files, split python fiels and views according to their model, split some data to ease module organization and understanding. Perform some code re-ordering in some big files in order to have code clearly separated by main usage and ease future changes. Quickly lint or update some view names. LINKS Task-2630969 Prepares Task-2600047 (code improvements and cleaning) COM PR odoo/odoo#75514 ENT PR odoo/enterprise#20424 UPG PR odoo/upgrade#2770
23 lines
920 B
Python
23 lines
920 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class Website(models.Model):
|
|
_inherit = 'website'
|
|
|
|
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 Teams',
|
|
default=lambda self: self.env['crm.team'].search([], limit=1),
|
|
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', domain=[('share', '=', False)],
|
|
help='Default salesperson for new leads created through the Contact Us form.')
|