37 lines
1.4 KiB
Python
37 lines
1.4 KiB
Python
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
# this repository contains the full copyright notices and license terms.
|
|
from trytond.model import ModelView, ModelSQL, ModelSingleton, fields
|
|
from trytond.transaction import Transaction
|
|
from trytond.pyson import Id
|
|
|
|
|
|
class Configuration(ModelSingleton, ModelSQL, ModelView):
|
|
'CRM Configuration'
|
|
__name__ = 'crm.configuration'
|
|
crm_customer_service_sequence = fields.Many2One('ir.sequence',
|
|
'Customer Service Sequence', required=True,
|
|
domain=[('sequence_type', '=',
|
|
Id('crm', 'sequence_type_crm')), ])
|
|
crm_survey_sequence = fields.Many2One('ir.sequence',
|
|
'Survey Sequence', required=True,
|
|
domain=[('sequence_type', '=',
|
|
Id('crm', 'sequence_crm_customer_service'))])
|
|
efficay_hour_limit = fields.Integer('Efficay Hour Limit',
|
|
required=True)
|
|
crm_activity_sequence = fields.Many2One('ir.sequence',
|
|
'Activity Sequence', required=True,
|
|
domain=[('sequence_type', '=',
|
|
Id('crm', 'sequence_crm_activity')])
|
|
company = fields.Many2One('company.company', 'Company', required=True)
|
|
|
|
@staticmethod
|
|
def default_company():
|
|
return Transaction().context.get('company')
|
|
|
|
@classmethod
|
|
def get_configuration(cls):
|
|
res = cls.search([
|
|
('company', '=', Transaction().context.get('company'))
|
|
])
|
|
return res[0]
|