2012-03-15 06:19:19 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# OpenERP, Open Source Management Solution
|
|
|
|
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
2012-03-26 11:49:53 +00:00
|
|
|
from osv import osv, fields
|
2012-03-15 06:19:19 +00:00
|
|
|
|
|
|
|
class project_claim_mail_configuration(osv.osv_memory):
|
|
|
|
_inherit = 'project.config.settings'
|
2012-03-15 07:04:39 +00:00
|
|
|
_columns = {
|
2012-03-15 07:21:08 +00:00
|
|
|
'project_claim': fields.boolean("Create claims from an email account",
|
2012-03-26 11:49:53 +00:00
|
|
|
help="""Allows you to configure your incoming mail server, and create claims from incoming emails."""),
|
2012-03-15 07:21:08 +00:00
|
|
|
'claim_server' : fields.char('Server Name', size=256),
|
|
|
|
'claim_port' : fields.integer('Port'),
|
|
|
|
'claim_type': fields.selection([
|
2012-03-26 11:49:53 +00:00
|
|
|
('pop', 'POP Server'),
|
|
|
|
('imap', 'IMAP Server'),
|
|
|
|
('local', 'Local Server'),
|
|
|
|
], 'Server Type'),
|
2012-03-15 07:21:08 +00:00
|
|
|
'claim_is_ssl': fields.boolean('SSL/TLS', help="Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP=995)"),
|
|
|
|
'claim_user' : fields.char('Username', size=256),
|
|
|
|
'claim_password' : fields.char('Password', size=1024),
|
2012-03-15 07:04:39 +00:00
|
|
|
}
|
|
|
|
_defaults = {
|
2012-03-15 07:21:08 +00:00
|
|
|
'claim_type': 'pop',
|
2012-03-15 07:04:39 +00:00
|
|
|
}
|
2012-03-15 06:19:19 +00:00
|
|
|
|
|
|
|
def get_default_claim_server(self, cr, uid, ids, context=None):
|
2012-03-15 07:04:39 +00:00
|
|
|
context.update({'type':'claim'})
|
2012-03-15 06:19:19 +00:00
|
|
|
res = self.get_default_email_configurations(cr, uid, ids, context)
|
|
|
|
return res
|
|
|
|
|
|
|
|
def set_default_claim_server(self, cr, uid, ids, context=None):
|
2012-03-15 07:04:39 +00:00
|
|
|
context.update({'type':'claim','obj':'crm.claim'})
|
2012-03-15 09:11:49 +00:00
|
|
|
self.set_email_configurations(cr, uid, ids, context)
|