From fa8413a04a850597dc071b223845b13c9381c88e Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 5 Mar 2012 18:10:25 +0530 Subject: [PATCH 1/9] [ADD] added new configuration for project bzr revid: tpa@tinyerp.com-20120305124025-mwfht28zzivcl6bz --- addons/project/__init__.py | 1 + addons/project/__openerp__.py | 3 +- addons/project/res_config.py | 64 ++++++++++++++++++++++++++++++ addons/project/res_config_view.xml | 63 +++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 addons/project/res_config.py create mode 100644 addons/project/res_config_view.xml diff --git a/addons/project/__init__.py b/addons/project/__init__.py index 01bef264e02..becd17f0b78 100644 --- a/addons/project/__init__.py +++ b/addons/project/__init__.py @@ -24,5 +24,6 @@ import company import report import wizard import res_partner +import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py index 96a7dc4f28f..3288910d587 100644 --- a/addons/project/__openerp__.py +++ b/addons/project/__openerp__.py @@ -57,7 +57,8 @@ Dashboard for project members that includes: "report/project_report_view.xml", "board_project_view.xml", 'board_project_manager_view.xml', - 'report/project_cumulative.xml' + 'report/project_cumulative.xml', + 'res_config_view.xml', ], 'demo_xml': [ 'project_demo.xml', diff --git a/addons/project/res_config.py b/addons/project/res_config.py new file mode 100644 index 00000000000..9d9e740324a --- /dev/null +++ b/addons/project/res_config.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +from osv import fields, osv +import pooler +from tools.translate import _ + +class project_configuration(osv.osv_memory): + _inherit = 'res.config.settings' + + _columns = { + 'module_project_mrp': fields.boolean('Allow to create tasks directly from a sale order', + help =""" + Automatically creates project tasks from procurement lines. + It installs the project_mrp module. + """), + 'module_pad': fields.boolean("Write project specification on collaborative note pad", + help="""Lets the company customize which Pad installation should be used to link to new pads + (by default, http://ietherpad.com/). + It installs the pad module."""), + 'module_project_timesheet': fields.boolean("Invoice working time on task", + help="""This allows you to transfer the entries under tasks defined for Project Management to + the Timesheet line entries for particular date and particular user with the effect of creating, editing and deleting either ways. + It installs the project_timesheet module."""), + 'module_project_scrum': fields.boolean("Allow to manage your project on Agile methodology", + help="""This allows to implement all concepts defined by the scrum project management methodology for IT companies. + * Project with sprints, product owner, scrum master + * Sprints with reviews, daily meetings, feedbacks + * Product backlog + * Sprint backlog + It installs the project_scrum module."""), + 'module_project_planning' : fields.boolean("Manage planning", + help="""This module helps you to manage your plannings. + each department manager can know if someone in his team has still unallocated time for a given planning (taking in consideration the validated leaves) or if he still needs to encode tasks. + It Installs project_planning module."""), + 'module_project_long_term': fields.boolean("Manage Long term planning", + help="""Long Term Project management module that tracks planning, scheduling, resources allocation. + It installs the project_long_term module."""), + '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_configuration() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/project/res_config_view.xml b/addons/project/res_config_view.xml new file mode 100644 index 00000000000..42eb4fd16ea --- /dev/null +++ b/addons/project/res_config_view.xml @@ -0,0 +1,63 @@ + + + + + Project Application + res.config.settings + form + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + Configure Project Application + ir.actions.act_window + res.config.settings + + form + form + + + + +
+
From 4fb9b7f104c014993beeca27e97e0ec120f1250b Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Tue, 6 Mar 2012 11:58:55 +0530 Subject: [PATCH 2/9] [IMP] create new view instead of inheriting bzr revid: tpa@tinyerp.com-20120306062855-21hizxmf9do7dt2l --- addons/project/res_config_view.xml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/addons/project/res_config_view.xml b/addons/project/res_config_view.xml index 42eb4fd16ea..639908ffb8c 100644 --- a/addons/project/res_config_view.xml +++ b/addons/project/res_config_view.xml @@ -5,10 +5,8 @@ Project Application res.config.settings form - -
- + @@ -42,9 +40,7 @@ - - - +
@@ -57,7 +53,7 @@ form - + From 69cd8bae3b95beefd97ff8e370819ff6f8a85f48 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Wed, 14 Mar 2012 11:58:23 +0530 Subject: [PATCH 3/9] [IMP] Improved code for incoming servers of project issue and claim,improved view bzr revid: tpa@tinyerp.com-20120314062823-lqxjr0lgski6rima --- addons/project/res_config.py | 130 ++++++++++++++++++++++++++++- addons/project/res_config_view.xml | 28 +++++-- 2 files changed, 149 insertions(+), 9 deletions(-) diff --git a/addons/project/res_config.py b/addons/project/res_config.py index 9d9e740324a..8b2826ff1ee 100644 --- a/addons/project/res_config.py +++ b/addons/project/res_config.py @@ -24,6 +24,7 @@ import pooler from tools.translate import _ class project_configuration(osv.osv_memory): + _name = 'project.configuration' _inherit = 'res.config.settings' _columns = { @@ -38,14 +39,14 @@ class project_configuration(osv.osv_memory): It installs the pad module."""), 'module_project_timesheet': fields.boolean("Invoice working time on task", help="""This allows you to transfer the entries under tasks defined for Project Management to - the Timesheet line entries for particular date and particular user with the effect of creating, editing and deleting either ways. + the timesheet line entries for particular date and particular user with the effect of creating, editing and deleting either ways. It installs the project_timesheet module."""), - 'module_project_scrum': fields.boolean("Allow to manage your project on Agile methodology", + 'module_project_scrum': fields.boolean("Allow to manage your project on agile methodology", help="""This allows to implement all concepts defined by the scrum project management methodology for IT companies. * Project with sprints, product owner, scrum master * Sprints with reviews, daily meetings, feedbacks * Product backlog - * Sprint backlog + * Sprint backlog. It installs the project_scrum module."""), 'module_project_planning' : fields.boolean("Manage planning", help="""This module helps you to manage your plannings. @@ -55,10 +56,131 @@ class project_configuration(osv.osv_memory): help="""Long Term Project management module that tracks planning, scheduling, resources allocation. It installs the project_long_term module."""), 'module_project_issue_sheet': fields.boolean("Track and invoice working time", - help="""Allows to the Timesheet support for the Issues/Bugs Management in Project. + help="""Allows to the timesheet support for the Issues/Bugs Management in Project. It installs the project_issue_sheet module."""), + 'module_project_issue': fields.boolean("Create issue from an email account", + help="""This allows you issues/bugs management in project + It installs the project_issue module."""), + '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), + 'module_crm_claim': fields.boolean("Create claims from an email account", + help="""This allows you to track your customers/suppliers claims and grievances. + It installs the crm_claim module."""), + '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 get_default_email_configurations(self, cr, uid, ids, context=None): + fetchmail_obj = self.pool.get('fetchmail.server') + result = {} + issue_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','!=','done')]) + if issue_ids: + issue_id = fetchmail_obj.browse(cr, uid, issue_ids[0], context=context) + result.update({'issue_server': issue_id.server}) + result.update({'issue_port': issue_id.port}) + result.update({'issue_is_ssl': issue_id.is_ssl}) + result.update({'issue_type': issue_id.type}) + result.update({'issue_user': issue_id.user}) + result.update({'issue_password': issue_id.password}) + + claim_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','!=','done')]) + if claim_ids: + claim_id = fetchmail_obj.browse(cr, uid, claim_ids[0], context=context) + result.update({'claim_server': claim_id.server}) + result.update({'claim_port': claim_id.port}) + result.update({'claim_is_ssl': claim_id.is_ssl}) + result.update({'claim_type': claim_id.type}) + result.update({'claim_user': claim_id.user}) + result.update({'claim_password': claim_id.password}) + + return result + + def onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False , type=[]): + port = 0 + values = {} + if server_type == 'pop': + port = ssl and 995 or 110 + elif server_type == 'imap': + port = ssl and 993 or 143 + else: + values[type+'_server'] = '' + values[type+'_port'] = port + return {'value': values} + + def set_email_configurations(self, cr, uid, ids, context=None): + model_obj = self.pool.get('ir.model') + fetchmail_obj = self.pool.get('fetchmail.server') + ir_values_obj = self.pool.get('ir.values') + issue_id = model_obj.search(cr, uid, [('model','=','project.issue')]) + claim_id = model_obj.search(cr, uid, [('model','=','crm.claim')]) + vals = self.read(cr, uid, ids[0], [], context=context) + if vals.get('module_project_issue') and issue_id: + issue_vals = { + 'name': 'Incoming Issues', + 'object_id': issue_id[0], + 'server': vals.get('issue_server'), + 'port': vals.get('issue_port'), + 'is_ssl': vals.get('issue_is_ssl'), + 'type': vals.get('issue_type'), + 'user': vals.get('issue_user'), + 'password': vals.get('issue_password') + } + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','!=','done')]) + if not server_ids: + server_ids = [fetchmail_obj.create(cr, uid, issue_vals, context=context)] + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues')], context=context) + fetchmail_obj.write(cr, uid, server_ids, issue_vals, context=context) + fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None) + + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','=','done')]) + fetchmail_obj.set_draft(cr, uid, server_ids, context=None) + + if vals.get('module_crm_claim') and claim_id: + claim_vals = { + 'name': 'Incoming Claims', + 'object_id': claim_id[0], + 'server': vals.get('claim_server'), + 'port': vals.get('claim_port'), + 'is_ssl': vals.get('claim_is_ssl'), + 'type': vals.get('claim_type'), + 'user': vals.get('claim_user'), + 'password': vals.get('claim_password') + } + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','!=','done')]) + if not server_ids: + server_ids = [fetchmail_obj.create(cr, uid, claim_vals, context=context)] + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims')], context=context) + fetchmail_obj.write(cr, uid, server_ids, claim_vals, context=context) + fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None) + + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','=','done')]) + fetchmail_obj.set_draft(cr, uid, server_ids, context=None) + project_configuration() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/project/res_config_view.xml b/addons/project/res_config_view.xml index 639908ffb8c..bde2e176905 100644 --- a/addons/project/res_config_view.xml +++ b/addons/project/res_config_view.xml @@ -3,7 +3,7 @@ Project Application - res.config.settings + project.configuration form
@@ -36,9 +36,27 @@ - - - + + + + + + + + + + + + + + + + + + + + +
@@ -47,7 +65,7 @@ Configure Project Application ir.actions.act_window - res.config.settings + project.configuration form form From dbe694c645ef83b186fe334431d022222d6b0df8 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Wed, 14 Mar 2012 15:18:57 +0530 Subject: [PATCH 4/9] [IMP] improved code bzr revid: tpa@tinyerp.com-20120314094857-l7kyyzl2cxzezq9x --- addons/fetchmail/__init__.py | 3 +- addons/fetchmail/res_config.py | 110 +++++++++++++++++++++++++++++ addons/project/res_config.py | 77 -------------------- addons/project/res_config_view.xml | 4 +- 4 files changed, 114 insertions(+), 80 deletions(-) create mode 100644 addons/fetchmail/res_config.py diff --git a/addons/fetchmail/__init__.py b/addons/fetchmail/__init__.py index 934df9846dd..7703c4d2f5b 100644 --- a/addons/fetchmail/__init__.py +++ b/addons/fetchmail/__init__.py @@ -1,7 +1,7 @@ #-*- coding:utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # mga@tinyerp.com # @@ -21,5 +21,6 @@ ############################################################################## import fetchmail +import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/fetchmail/res_config.py b/addons/fetchmail/res_config.py new file mode 100644 index 00000000000..e51129006dc --- /dev/null +++ b/addons/fetchmail/res_config.py @@ -0,0 +1,110 @@ +#-*- coding:utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# mga@tinyerp.com +# +# 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 . +# +############################################################################## + +from osv import fields, osv +import pooler +from tools.translate import _ + +class project_configuration(osv.osv_memory): + _inherit = 'res.config.settings' + + def get_default_email_configurations(self, cr, uid, ids, context=None): + fetchmail_obj = self.pool.get('fetchmail.server') + result = {} + issue_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','!=','done')]) + if issue_ids: + issue_id = fetchmail_obj.browse(cr, uid, issue_ids[0], context=context) + result.update({'issue_server': issue_id.server}) + result.update({'issue_port': issue_id.port}) + result.update({'issue_is_ssl': issue_id.is_ssl}) + result.update({'issue_type': issue_id.type}) + result.update({'issue_user': issue_id.user}) + result.update({'issue_password': issue_id.password}) + + claim_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','!=','done')]) + if claim_ids: + claim_id = fetchmail_obj.browse(cr, uid, claim_ids[0], context=context) + result.update({'claim_server': claim_id.server}) + result.update({'claim_port': claim_id.port}) + result.update({'claim_is_ssl': claim_id.is_ssl}) + result.update({'claim_type': claim_id.type}) + result.update({'claim_user': claim_id.user}) + result.update({'claim_password': claim_id.password}) + + return result + + def set_email_configurations(self, cr, uid, ids, context=None): + model_obj = self.pool.get('ir.model') + fetchmail_obj = self.pool.get('fetchmail.server') + ir_values_obj = self.pool.get('ir.values') + issue_id = model_obj.search(cr, uid, [('model','=','project.issue')]) + claim_id = model_obj.search(cr, uid, [('model','=','crm.claim')]) + vals = self.read(cr, uid, ids[0], [], context=context) + if vals.get('module_project_issue') and issue_id: + issue_vals = { + 'name': 'Incoming Issues', + 'object_id': issue_id[0], + 'server': vals.get('issue_server'), + 'port': vals.get('issue_port'), + 'is_ssl': vals.get('issue_is_ssl'), + 'type': vals.get('issue_type'), + 'user': vals.get('issue_user'), + 'password': vals.get('issue_password') + } + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','!=','done')]) + if not server_ids: + server_ids = [fetchmail_obj.create(cr, uid, issue_vals, context=context)] + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues')], context=context) + fetchmail_obj.write(cr, uid, server_ids, issue_vals, context=context) + fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None) + + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','=','done')]) + fetchmail_obj.set_draft(cr, uid, server_ids, context=None) + + if vals.get('module_crm_claim') and claim_id: + claim_vals = { + 'name': 'Incoming Claims', + 'object_id': claim_id[0], + 'server': vals.get('claim_server'), + 'port': vals.get('claim_port'), + 'is_ssl': vals.get('claim_is_ssl'), + 'type': vals.get('claim_type'), + 'user': vals.get('claim_user'), + 'password': vals.get('claim_password') + } + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','!=','done')]) + if not server_ids: + server_ids = [fetchmail_obj.create(cr, uid, claim_vals, context=context)] + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims')], context=context) + fetchmail_obj.write(cr, uid, server_ids, claim_vals, context=context) + fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None) + + else: + server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','=','done')]) + fetchmail_obj.set_draft(cr, uid, server_ids, context=None) + + +project_configuration() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/project/res_config.py b/addons/project/res_config.py index 8b2826ff1ee..bdb67b8b001 100644 --- a/addons/project/res_config.py +++ b/addons/project/res_config.py @@ -24,7 +24,6 @@ import pooler from tools.translate import _ class project_configuration(osv.osv_memory): - _name = 'project.configuration' _inherit = 'res.config.settings' _columns = { @@ -91,30 +90,6 @@ class project_configuration(osv.osv_memory): 'claim_type': 'pop', } - def get_default_email_configurations(self, cr, uid, ids, context=None): - fetchmail_obj = self.pool.get('fetchmail.server') - result = {} - issue_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','!=','done')]) - if issue_ids: - issue_id = fetchmail_obj.browse(cr, uid, issue_ids[0], context=context) - result.update({'issue_server': issue_id.server}) - result.update({'issue_port': issue_id.port}) - result.update({'issue_is_ssl': issue_id.is_ssl}) - result.update({'issue_type': issue_id.type}) - result.update({'issue_user': issue_id.user}) - result.update({'issue_password': issue_id.password}) - - claim_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','!=','done')]) - if claim_ids: - claim_id = fetchmail_obj.browse(cr, uid, claim_ids[0], context=context) - result.update({'claim_server': claim_id.server}) - result.update({'claim_port': claim_id.port}) - result.update({'claim_is_ssl': claim_id.is_ssl}) - result.update({'claim_type': claim_id.type}) - result.update({'claim_user': claim_id.user}) - result.update({'claim_password': claim_id.password}) - - return result def onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False , type=[]): port = 0 @@ -128,58 +103,6 @@ class project_configuration(osv.osv_memory): values[type+'_port'] = port return {'value': values} - def set_email_configurations(self, cr, uid, ids, context=None): - model_obj = self.pool.get('ir.model') - fetchmail_obj = self.pool.get('fetchmail.server') - ir_values_obj = self.pool.get('ir.values') - issue_id = model_obj.search(cr, uid, [('model','=','project.issue')]) - claim_id = model_obj.search(cr, uid, [('model','=','crm.claim')]) - vals = self.read(cr, uid, ids[0], [], context=context) - if vals.get('module_project_issue') and issue_id: - issue_vals = { - 'name': 'Incoming Issues', - 'object_id': issue_id[0], - 'server': vals.get('issue_server'), - 'port': vals.get('issue_port'), - 'is_ssl': vals.get('issue_is_ssl'), - 'type': vals.get('issue_type'), - 'user': vals.get('issue_user'), - 'password': vals.get('issue_password') - } - server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','!=','done')]) - if not server_ids: - server_ids = [fetchmail_obj.create(cr, uid, issue_vals, context=context)] - else: - server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues')], context=context) - fetchmail_obj.write(cr, uid, server_ids, issue_vals, context=context) - fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None) - - else: - server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Issues'),('state','=','done')]) - fetchmail_obj.set_draft(cr, uid, server_ids, context=None) - - if vals.get('module_crm_claim') and claim_id: - claim_vals = { - 'name': 'Incoming Claims', - 'object_id': claim_id[0], - 'server': vals.get('claim_server'), - 'port': vals.get('claim_port'), - 'is_ssl': vals.get('claim_is_ssl'), - 'type': vals.get('claim_type'), - 'user': vals.get('claim_user'), - 'password': vals.get('claim_password') - } - server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','!=','done')]) - if not server_ids: - server_ids = [fetchmail_obj.create(cr, uid, claim_vals, context=context)] - else: - server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims')], context=context) - fetchmail_obj.write(cr, uid, server_ids, claim_vals, context=context) - fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None) - - else: - server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Claims'),('state','=','done')]) - fetchmail_obj.set_draft(cr, uid, server_ids, context=None) project_configuration() diff --git a/addons/project/res_config_view.xml b/addons/project/res_config_view.xml index bde2e176905..564106d5998 100644 --- a/addons/project/res_config_view.xml +++ b/addons/project/res_config_view.xml @@ -3,7 +3,7 @@ Project Application - project.configuration + res.config.settings form
@@ -65,7 +65,7 @@ Configure Project Application ir.actions.act_window - project.configuration + res.config.settings form form From aca13da679879bbe88e12fff23d82393dab37c20 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Wed, 14 Mar 2012 18:02:06 +0530 Subject: [PATCH 5/9] [IMP] improved code for incoming server configuration bzr revid: tpa@tinyerp.com-20120314123206-zg8u3sc4oy3dc0u8 --- addons/base_setup/base_setup.py | 7 ++ addons/base_setup/base_setup_views.xml | 27 ++++- addons/fetchmail/res_config.py | 10 +- addons/fetchmail_crm_claim/__openerp__.py | 1 + .../fetchmail_crm_claim/res_config_view.xml | 27 +++++ addons/project/res_config.py | 14 ++- addons/project/res_config_view.xml | 98 +++++++------------ addons/project_issue/__openerp__.py | 1 + addons/project_issue/res_config_view.xml | 26 +++++ 9 files changed, 137 insertions(+), 74 deletions(-) create mode 100644 addons/fetchmail_crm_claim/res_config_view.xml create mode 100644 addons/project_issue/res_config_view.xml diff --git a/addons/base_setup/base_setup.py b/addons/base_setup/base_setup.py index c10dee7b14b..6ae3dd07e8f 100644 --- a/addons/base_setup/base_setup.py +++ b/addons/base_setup/base_setup.py @@ -201,4 +201,11 @@ class specify_partner_terminology(osv.osv_memory): self.make_translations(cr, uid, ids, act_ref, 'model', act_id.help, _case_insensitive_replace(act_id.help,'Customer',o.partner), res_id=act_id.id, context=context) return {} + +# Preferences wizard for Project & crm. +# It is defined here because it must be inherited independently in modules project and crm. +class project_config_settings(osv.osv_memory): + _name = 'project.config.settings' + _inherit = 'res.config.settings' + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_setup/base_setup_views.xml b/addons/base_setup/base_setup_views.xml index 4155c7e9957..9986201f5bd 100644 --- a/addons/base_setup/base_setup_views.xml +++ b/addons/base_setup/base_setup_views.xml @@ -117,7 +117,7 @@ form new -