Skip to content
Permalink
Browse files

[IMP] crm: code linting

Move some variables to the right file
  • Loading branch information
tde-banana-odoo committed Jan 6, 2020
1 parent ca96ac6 commit be04009a9a44e9b4eee1bd1e9b662939193a7270
@@ -47,6 +47,13 @@
'email_cc',
'website']

AVAILABLE_PRIORITIES = [
('0', 'Low'),
('1', 'Medium'),
('2', 'High'),
('3', 'Very High'),
]


class Lead(models.Model):
_name = "crm.lead"
@@ -74,8 +81,8 @@ class Lead(models.Model):
index=True, required=True, tracking=15,
default=lambda self: 'lead' if self.env['res.users'].has_group('crm.group_use_lead') else 'opportunity')
priority = fields.Selection(
crm_stage.AVAILABLE_PRIORITIES, string='Priority', index=True,
default=crm_stage.AVAILABLE_PRIORITIES[0][0])
AVAILABLE_PRIORITIES, string='Priority', index=True,
default=AVAILABLE_PRIORITIES[0][0])
team_id = fields.Many2one(
'crm.team', string='Sales Team', index=True, tracking=True,
compute='_compute_team_id', readonly=False, store=True)
@@ -1126,7 +1133,7 @@ def message_new(self, msg_dict, custom_values=None):
'email_from': msg_dict.get('from'),
'partner_id': msg_dict.get('author_id', False),
}
if msg_dict.get('priority') in dict(crm_stage.AVAILABLE_PRIORITIES):
if msg_dict.get('priority') in dict(AVAILABLE_PRIORITIES):
defaults['priority'] = msg_dict.get('priority')
defaults.update(custom_values)

@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import fields, models


@@ -3,14 +3,6 @@

from odoo import api, fields, models

AVAILABLE_PRIORITIES = [
('0', 'Low'),
('1', 'Medium'),
('2', 'High'),
('3', 'Very High'),
]


class Stage(models.Model):
""" Model for case stages. This models the main stages of a document
management flow. Main CRM objects (leads, opportunities, project
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import api, fields, models, _
from odoo import fields, models, _
from odoo.exceptions import AccessError


@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from odoo import api, fields, models
from odoo import fields, models


class CrmLeadLost(models.TransientModel):
@@ -10,7 +10,7 @@
import odoo
from odoo import api, fields, models, tools, _
from odoo.addons.iap import jsonrpc
from odoo.addons.crm.models import crm_stage
from odoo.addons.crm.models import crm_lead
from odoo.exceptions import ValidationError

_logger = logging.getLogger(__name__)
@@ -55,7 +55,7 @@ class CRMRevealRule(models.Model):
team_id = fields.Many2one('crm.team', string='Sales Team')
tag_ids = fields.Many2many('crm.lead.tag', string='Tags')
user_id = fields.Many2one('res.users', string='Salesperson')
priority = fields.Selection(crm_stage.AVAILABLE_PRIORITIES, string='Priority')
priority = fields.Selection(crm_lead.AVAILABLE_PRIORITIES, string='Priority')
lead_ids = fields.One2many('crm.lead', 'reveal_rule_id', string='Generated Lead / Opportunity')
leads_count = fields.Integer(compute='_compute_leads_count', string='Number of Generated Leads')
opportunity_count = fields.Integer(compute='_compute_leads_count', string='Number of Generated Opportunity')

0 comments on commit be04009

Please sign in to comment.
You can’t perform that action at this time.