[IMP] improved code

bzr revid: tpa@tinyerp.com-20120315070439-mbznk83iq6vpgicp
This commit is contained in:
Turkesh Patel (Open ERP)
2012-03-15 12:34:39 +05:30
parent 5bec1d9edb
commit ba8afac015
6 changed files with 38 additions and 34 deletions
+1
View File
@@ -44,6 +44,7 @@ automatically new claims based on incoming emails.
'crm_claim_menu.xml',
'security/ir.model.access.csv',
'report/crm_claim_report_view.xml',
'res_config_view.xml',
],
'demo_xml': [
'crm_claim_demo.xml',
+19 -2
View File
@@ -23,15 +23,32 @@ from osv import fields, osv
class project_claim_mail_configuration(osv.osv_memory):
_inherit = 'project.config.settings'
_columns = {
'project_issue': fields.boolean("Create issue from an email account",
help="""Allows you to configure your incoming mail server. And creates issue for your mails."""),
'issue_server' : fields.char('Server Name', size=256),
'issue_port' : fields.integer('Port'),
'issue_type': fields.selection([
('pop', 'POP Server'),
('imap', 'IMAP Server'),
('local', 'Local Server'),
], 'Server Type'),
'issue_is_ssl': fields.boolean('SSL/TLS', help="Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP=995)"),
'issue_user' : fields.char('Username', size=256),
'issue_password' : fields.char('Password', size=1024),
}
_defaults = {
'issue_type': 'pop',
}
def get_default_claim_server(self, cr, uid, ids, context=None):
context = {'type':'issue'}
context.update({'type':'claim'})
res = self.get_default_email_configurations(cr, uid, ids, context)
return res
def set_default_claim_server(self, cr, uid, ids, context=None):
context = {'type':'claim','obj':'crm.claim'}
context.update({'type':'claim','obj':'crm.claim'})
res = self.set_email_configurations(cr, uid, ids, context)
project_claim_mail_configuration()
@@ -31,7 +31,6 @@
'init_xml': [],
'update_xml': [
"installer.xml",
"res_config_view.xml",
],
'demo_xml': [
],
-31
View File
@@ -57,39 +57,8 @@ class project_configuration(osv.osv_memory):
'module_project_issue_sheet': fields.boolean("Track and invoice working time",
help="""Allows to the timesheet support for the Issues/Bugs Management in Project.
It installs the project_issue_sheet module."""),
'project_issue': fields.boolean("Create issue from an email account",
help="""Allows you to configure your incoming mail server. And creates issue for your mails."""),
'issue_server' : fields.char('Server Name', size=256),
'issue_port' : fields.integer('Port'),
'issue_type': fields.selection([
('pop', 'POP Server'),
('imap', 'IMAP Server'),
('local', 'Local Server'),
], 'Server Type'),
'issue_is_ssl': fields.boolean('SSL/TLS', help="Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP=995)"),
'issue_user' : fields.char('Username', size=256),
'issue_password' : fields.char('Password', size=1024),
'project_claim': fields.boolean("Create claims from an email account",
help="""Allows you to configure your incoming mail server. And creates claims for your mails.
"""),
'claim_server' : fields.char('Server Name', size=256),
'claim_port' : fields.integer('Port'),
'claim_type': fields.selection([
('pop', 'POP Server'),
('imap', 'IMAP Server'),
('local', 'Local Server'),
], 'Server Type'),
'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),
}
_defaults = {
'issue_type': 'pop',
'claim_type': 'pop',
}
def onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False , type=[]):
port = 0
values = {}
+18
View File
@@ -23,6 +23,24 @@ from osv import fields, osv
class project_issue_mail_configuration(osv.osv_memory):
_inherit = 'project.config.settings'
_columns = {
'project_claim': fields.boolean("Create claims from an email account",
help="""Allows you to configure your incoming mail server. And creates claims for your mails.
"""),
'claim_server' : fields.char('Server Name', size=256),
'claim_port' : fields.integer('Port'),
'claim_type': fields.selection([
('pop', 'POP Server'),
('imap', 'IMAP Server'),
('local', 'Local Server'),
], 'Server Type'),
'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),
}
_defaults = {
'claim_type': 'pop',
}
def get_default_issue_server(self, cr, uid, ids, context=None):
context = {'type':'claim'}