Turkesh Patel (openERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-v62_projct_config-tpa into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-v62_projct_config-tpa/+merge/97596

       
    Project

================================================================

*[ADD] Added a new configuration wizard for Project application.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-v62_projct_config-tpa/+merge/97596
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-v62_projct_config-tpa.
=== modified file 'base_setup/base_setup.py'
--- base_setup/base_setup.py	2011-12-19 16:54:40 +0000
+++ base_setup/base_setup.py	2012-03-15 09:17:27 +0000
@@ -201,4 +201,11 @@
                 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:

=== modified file 'base_setup/base_setup_views.xml'
--- base_setup/base_setup_views.xml	2012-02-08 13:31:29 +0000
+++ base_setup/base_setup_views.xml	2012-03-15 09:17:27 +0000
@@ -117,7 +117,7 @@
           <field name="view_mode">form</field>
           <field name="target">new</field>
       </record>
-   <!-- 
+   <!--
       <record id="config_action_partner_terminology_config_form" model="ir.actions.todo">
           <field name="action_id" ref="action_partner_terminology_config_form"/>
           <field name="category_id" ref="base.category_administration_config"/>
@@ -142,5 +142,30 @@
         <field name="sequence">1</field>
     </record>
 
+
+   <record id="base.project_settings_form_view" model="ir.ui.view">
+        <field name="name">project.config.settings</field>
+        <field name="model">project.config.settings</field>
+        <field name="type">form</field>
+        <field name="arch" type="xml">
+            <form string="Configure Project">
+                <group name="Project" colspan="4">
+                </group>
+                <group name="Helpdesk and support" colspan="4">
+                <separator string="Helpdesk and support" colspan="4"/>
+                </group>
+            </form>
+        </field>
+    </record>
+
+    <record id="base.action_project_config" model="ir.actions.act_window">
+        <field name="name">Configure Project</field>
+        <field name="type">ir.actions.act_window</field>
+        <field name="res_model">project.config.settings</field>
+        <field name="view_id" ref="base.project_settings_form_view"/>
+        <field name="view_type">form</field>
+        <field name="view_mode">form</field>
+    </record>
+
   </data>
 </openerp>

=== modified file 'crm_claim/__init__.py'
--- crm_claim/__init__.py	2011-01-14 00:11:01 +0000
+++ crm_claim/__init__.py	2012-03-15 09:17:27 +0000
@@ -21,6 +21,7 @@
 
 import crm_claim
 import report
+import res_config
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 

=== modified file 'crm_claim/__openerp__.py'
--- crm_claim/__openerp__.py	2012-01-31 13:36:57 +0000
+++ crm_claim/__openerp__.py	2012-03-15 09:17:27 +0000
@@ -44,6 +44,7 @@
         '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',

=== added file 'crm_claim/res_config.py'
--- crm_claim/res_config.py	1970-01-01 00:00:00 +0000
+++ crm_claim/res_config.py	2012-03-15 09:17:27 +0000
@@ -0,0 +1,55 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class project_claim_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_claim_server(self, cr, uid, ids, context=None):
+        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.update({'type':'claim','obj':'crm.claim'})
+        self.set_email_configurations(cr, uid, ids, context)
+
+project_claim_mail_configuration()
\ No newline at end of file

=== added file 'crm_claim/res_config_view.xml'
--- crm_claim/res_config_view.xml	1970-01-01 00:00:00 +0000
+++ crm_claim/res_config_view.xml	2012-03-15 09:17:27 +0000
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_project_config_claim" model="ir.ui.view">
+            <field name="name">Project Application</field>
+            <field name="model">project.config.settings</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="base.project_settings_form_view"/>
+            <field name="arch" type="xml">
+                <xpath expr="//form/group[@name='Helpdesk and support']" position="inside">
+                    <field name="project_claim"/>
+                    <group col="4" colspan="2" attrs="{'invisible': [('project_claim','=',False)]}">
+                          <field name="claim_server" attrs="{'required': [('project_claim','=',True)]}"/>
+                          <field name="claim_type" nolabel="1" on_change="onchange_server_type(claim_type, claim_is_ssl,'claim')" attrs="{'required': [('project_claim','=',True)]}"/>
+                          <field name="claim_port" attrs="{'required': [('project_claim','=',True)]}"/>
+                          <field name="claim_is_ssl" on_change="onchange_server_type(claim_type, claim_is_ssl,'claim')"/>
+                          <newline/>
+                          <field name="claim_user" attrs="{'required': [('project_claim','=',True)]}"/>
+                          <field name="claim_password" password="True" attrs="{'required': [('project_claim','=',True)]}"/>
+                    </group>
+                </xpath>
+            </field>
+        </record>
+
+    </data>
+</openerp>
\ No newline at end of file

=== modified file 'fetchmail/__init__.py'
--- fetchmail/__init__.py	2011-12-19 16:54:40 +0000
+++ fetchmail/__init__.py	2012-03-15 09:17:27 +0000
@@ -1,7 +1,7 @@
 #-*- coding:utf-8 -*-
 ##############################################################################
 #
-#    OpenERP, Open Source Management Solution    
+#    OpenERP, Open Source Management Solution
 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
 #    [email protected]
 #
@@ -21,5 +21,6 @@
 ##############################################################################
 
 import fetchmail
+import res_config
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'fetchmail/res_config.py'
--- fetchmail/res_config.py	1970-01-01 00:00:00 +0000
+++ fetchmail/res_config.py	2012-03-15 09:17:27 +0000
@@ -0,0 +1,85 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+#    [email protected]
+#
+#    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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+import pooler
+from tools.translate import _
+
+class project_configuration(osv.osv_memory):
+    _inherit = 'project.config.settings'
+
+    def get_default_email_configurations(self, cr, uid, ids, context=None):
+        fetchmail_obj = self.pool.get('fetchmail.server')
+        result = {}
+        if not context:
+            context = {}
+        type = context.get('type')
+        if type:
+            server_ids = fetchmail_obj.search(cr, uid, [('name','=',type),('state','=','done')])
+            if server_ids:
+                result.update({'project_'+type: True})
+                server_id = fetchmail_obj.browse(cr, uid, server_ids[0])
+                result.update({type+'_server': server_id.server})
+                result.update({type+'_port': server_id.port})
+                result.update({type+'_is_ssl': server_id.is_ssl})
+                result.update({type+'_type': server_id.type})
+                result.update({type+'_user': server_id.user})
+                result.update({type+'_password': server_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')
+        if not context:
+            context = {}
+        type = context.get('type')
+        model = context.get('obj')
+        if type and model:
+            object_id = model_obj.search(cr, uid, [('model','=',model)])
+            vals = self.read(cr, uid, ids[0], [], context=context)
+            if vals.get('project_'+type) and object_id:
+                server_vals = {
+                        'name': type,
+                        'object_id': object_id[0],
+                        'server': vals.get(type+'_server'),
+                        'port': vals.get(type+'_port'),
+                        'is_ssl': vals.get(type+'_is_ssl'),
+                        'type': vals.get(type+'_type'),
+                        'user': vals.get(type+'_user'),
+                        'password': vals.get(type+'_password')
+                }
+                server_ids = fetchmail_obj.search(cr, uid, [('name','=',type),('state','!=','done')])
+                if not server_ids:
+                    server_ids = [fetchmail_obj.create(cr, uid, server_vals, context=context)]
+                else:
+                    server_ids = fetchmail_obj.search(cr, uid, [('name','=',type)], context=context)
+                    fetchmail_obj.write(cr, uid, server_ids, server_vals, context=context)
+                fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None)
+
+            else:
+                server_ids = fetchmail_obj.search(cr, uid, [('name','=',type),('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

=== modified file 'project/__init__.py'
--- project/__init__.py	2011-10-11 20:05:49 +0000
+++ project/__init__.py	2012-03-15 09:17:27 +0000
@@ -24,5 +24,6 @@
 import report
 import wizard
 import res_partner
+import res_config
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'project/__openerp__.py'
--- project/__openerp__.py	2012-02-13 15:27:55 +0000
+++ project/__openerp__.py	2012-03-15 09:17:27 +0000
@@ -57,7 +57,8 @@
         "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',

=== added file 'project/res_config.py'
--- project/res_config.py	1970-01-01 00:00:00 +0000
+++ project/res_config.py	2012-03-15 09:17:27 +0000
@@ -0,0 +1,74 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class project_configuration(osv.osv_memory):
+    _inherit = 'project.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."""),
+    }
+
+    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}
+
+project_configuration()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

=== added file 'project/res_config_view.xml'
--- project/res_config_view.xml	1970-01-01 00:00:00 +0000
+++ project/res_config_view.xml	2012-03-15 09:17:27 +0000
@@ -0,0 +1,51 @@
+<openerp>
+    <data>
+
+        <record id="view_project_config" model="ir.ui.view">
+            <field name="name">Project Application</field>
+            <field name="model">project.config.settings</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="base.project_settings_form_view"/>
+            <field name="arch" type="xml">
+                <xpath expr="//form/group[@name='Project']" position="inside">
+	                <group name="Project" position="inside">
+			            <separator string="Project" colspan="4"/>
+			            <group colspan="4" col="8">
+			                <group  colspan="4" col="4">
+			                   <field name="module_project_mrp"/>
+			                   <newline/>
+			                   <field name="module_pad"/>
+			                   <newline/>
+			                </group>
+			                <group colspan="4" col="4">
+			                    <newline/>
+			                    <field name="module_project_timesheet"/>
+			                    <newline/>
+			                    <field name="module_project_scrum"/>
+			                    <newline/>
+			                </group>
+			            </group>
+
+			            <separator string="Planning" colspan="4"/>
+	                    <group  colspan="4" col="4">
+	                        <group  colspan="4" col="4">
+	                           <field name="module_project_planning"/>
+	                        </group>
+	                        <group colspan="4" col="4">
+	                            <field name="module_project_long_term"/>
+	                        </group>
+	                    </group>
+	                </group>
+                </xpath>
+
+                 <xpath expr="//form/group[@name='Helpdesk and support']" position="inside">
+                        <field name="module_project_issue_sheet" colspan="4"/>
+                 </xpath>
+
+            </field>
+        </record>
+
+        <menuitem id="base.menu_project_config" name="Project" parent="base.menu_config" sequence="1" action="base.action_project_config"/>
+
+    </data>
+</openerp>

=== modified file 'project_issue/__init__.py'
--- project_issue/__init__.py	2011-09-07 21:15:47 +0000
+++ project_issue/__init__.py	2012-03-15 09:17:27 +0000
@@ -22,5 +22,6 @@
 
 import project_issue
 import report
+import res_config
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'project_issue/__openerp__.py'
--- project_issue/__openerp__.py	2012-02-13 15:27:55 +0000
+++ project_issue/__openerp__.py	2012-03-15 09:17:27 +0000
@@ -52,6 +52,7 @@
         'security/project_issue_security.xml',
         'security/ir.model.access.csv',
         "board_project_issue_view.xml",
+        "res_config_view.xml",
      ],
     'demo_xml': ['project_issue_demo.xml'],
     'test': [

=== added file 'project_issue/res_config.py'
--- project_issue/res_config.py	1970-01-01 00:00:00 +0000
+++ project_issue/res_config.py	2012-03-15 09:17:27 +0000
@@ -0,0 +1,55 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class project_issue_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_issue_server(self, cr, uid, ids, context=None):
+        context.update({'type':'issue'})
+        res = self.get_default_email_configurations(cr, uid, ids, context)
+        return res
+
+    def set_default_issue_server(self, cr, uid, ids, context=None):
+        context.update({'type':'issue','obj':'project.issue'})
+        self.set_email_configurations(cr, uid, ids, context)
+
+
+project_issue_mail_configuration()
\ No newline at end of file

=== added file 'project_issue/res_config_view.xml'
--- project_issue/res_config_view.xml	1970-01-01 00:00:00 +0000
+++ project_issue/res_config_view.xml	2012-03-15 09:17:27 +0000
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_project_config_issue" model="ir.ui.view">
+            <field name="name">Project Application</field>
+            <field name="model">project.config.settings</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="project.view_project_config"/>
+            <field name="arch" type="xml">
+                <xpath expr="//form/group[@name='Helpdesk and support']" position="inside">
+                    <field name="project_issue"/>
+                    <group col="4" colspan="2" attrs="{'invisible': [('project_issue','=',False)]}">
+                        <field name="issue_server" attrs="{'required': [('project_issue','=',True)]}"/>
+                        <field name="issue_type" nolabel="1" on_change="onchange_server_type(issue_type, issue_is_ssl,'issue')" attrs="{'required': [('project_issue','=',True)]}"/>
+                        <field name="issue_port" attrs="{'required': [('project_issue','=',True)]}"/>
+                        <field name="issue_is_ssl" on_change="onchange_server_type(issue_type, issue_is_ssl, 'issue')"/>
+                        <newline/>
+                        <field name="issue_user" attrs="{'required': [('project_issue','=',True)]}"/>
+                        <field name="issue_password" password="True" attrs="{'required': [('project_issue','=',True)]}"/>
+                    </group>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>
\ No newline at end of file

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to