From 0ca643e53127a8eb43cc46ad7008dcc922f93b6c Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Fri, 23 Mar 2012 18:43:36 +0530 Subject: [PATCH 001/129] [IMP] knowledge: add the configuration wizard bzr revid: jap@tinyerp.com-20120323131336-88jmei14iuxh3vm8 --- addons/document/__init__.py | 1 + addons/document/__openerp__.py | 1 + addons/document/res_config.py | 54 +++++++++++++++++++++++++++++ addons/document/res_config_view.xml | 37 ++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 addons/document/res_config.py create mode 100644 addons/document/res_config_view.xml diff --git a/addons/document/__init__.py b/addons/document/__init__.py index 12306b0499b..fd108da7fbc 100644 --- a/addons/document/__init__.py +++ b/addons/document/__init__.py @@ -28,5 +28,6 @@ import directory_report import document import report import wizard +import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document/__openerp__.py b/addons/document/__openerp__.py index 6691ab53da3..ee34a8b01ec 100644 --- a/addons/document/__openerp__.py +++ b/addons/document/__openerp__.py @@ -55,6 +55,7 @@ ATTENTION: 'security/ir.model.access.csv', 'report/document_report_view.xml', 'board_document_view.xml', + 'res_config_view.xml', ], 'demo_xml': [ 'document_demo.xml','board_document_demo.xml'], 'test': [ diff --git a/addons/document/res_config.py b/addons/document/res_config.py new file mode 100644 index 00000000000..7bf27ae91ec --- /dev/null +++ b/addons/document/res_config.py @@ -0,0 +1,54 @@ +# -*- 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 + +class knowledge_configuration(osv.osv_memory): + _name = 'knowledge.configuration' + _inherit = 'res.config.settings' + + _columns = { + 'module_wiki_quality_manual': fields.boolean('Use an internal wiki to group FAQ', + help =""" + It installs the wiki_quality_manual module. + """), + 'module_wiki_faq': fields.boolean('Track quality with wiki', + help =""" + It install the wiki_faq. + """), + 'module_document_ftp': fields.boolean('Share repositories (FTP)', + help =""" + It install the document_ftp. + """), + 'server_address_port': fields.char('Server address/IP and port',size=128, + help =""" + It assign server address/IP and port. + """), + 'module_document_webdav': fields.boolean('Share Repositories (WebDAV)', + help =""" + It install the document_webdav. + """), + + } + +knowledge_configuration() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/document/res_config_view.xml b/addons/document/res_config_view.xml new file mode 100644 index 00000000000..0794a9e8e86 --- /dev/null +++ b/addons/document/res_config_view.xml @@ -0,0 +1,37 @@ + + + + + Knowledge Application + knowledge.configuration + form + +
+ + + + + + + + + + + + +
+
+ + + Configure Knowledge Application + ir.actions.act_window + knowledge.configuration + + form + form + + + + +
+
From 45e10ba3b1a757b9534453e8a50939eee28dcda0 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 27 Mar 2012 14:48:54 +0530 Subject: [PATCH 002/129] [IMP] Marketing: add the configuration wizard bzr revid: jap@tinyerp.com-20120327091854-541dh2fpygomlw3i --- addons/marketing/__init__.py | 1 + addons/marketing/__openerp__.py | 3 +- addons/marketing/res_config.py | 41 ++++++++++++++++++++++++++++ addons/marketing/res_config_view.xml | 37 +++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 addons/marketing/res_config.py create mode 100644 addons/marketing/res_config_view.xml diff --git a/addons/marketing/__init__.py b/addons/marketing/__init__.py index e68279cad8d..2366f61813b 100644 --- a/addons/marketing/__init__.py +++ b/addons/marketing/__init__.py @@ -19,6 +19,7 @@ # ############################################################################## +import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/marketing/__openerp__.py b/addons/marketing/__openerp__.py index c097c22b84e..8088a0a1a1b 100644 --- a/addons/marketing/__openerp__.py +++ b/addons/marketing/__openerp__.py @@ -38,7 +38,8 @@ Contains the installer for marketing-related modules. 'update_xml': [ 'security/marketing_security.xml', 'security/ir.model.access.csv', - 'marketing_view.xml' + 'marketing_view.xml', + 'res_config_view.xml', ], 'demo_xml': ['marketing_demo.xml'], 'installable': True, diff --git a/addons/marketing/res_config.py b/addons/marketing/res_config.py new file mode 100644 index 00000000000..996b7ab882f --- /dev/null +++ b/addons/marketing/res_config.py @@ -0,0 +1,41 @@ +# -*- 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 + +class marketing_configuration(osv.osv_memory): + _name = 'marketing.configuration' + _inherit = 'res.config.settings' + + _columns = { + 'module_marketing': fields.boolean('Marketing', + help ="""It installs the marketing_campaign module."""), + 'module_marketing_campaign': fields.boolean('Marketing Campaign', + help ="""It installs the marketing_campaign module."""), + 'module_marketing_campaign_crm_demo': fields.boolean('Demo data for the module Marketing Campaign', + help ="""It installs the marketing_campaign_crm_demo module."""), + 'module_crm_profiling': fields.boolean('Track customer profile to focus your campaigns', + help ="""It install the crm_profiling module."""), + } + +marketing_configuration() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/marketing/res_config_view.xml b/addons/marketing/res_config_view.xml new file mode 100644 index 00000000000..c87969ca3f6 --- /dev/null +++ b/addons/marketing/res_config_view.xml @@ -0,0 +1,37 @@ + + + + + Marketing Application + marketing.configuration + form + +
+ + + + + + + + + + + + +
+
+ + + Configure Marketing Application + ir.actions.act_window + marketing.configuration + + form + form + + + + +
+
From e82a00cf529bbb9284e4de1f1de89fcaf6829613 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 27 Mar 2012 17:45:17 +0530 Subject: [PATCH 003/129] [IMP] Reporting: add the configuration wizard bzr revid: jap@tinyerp.com-20120327121517-ueys9efvabb06b88 --- addons/report_designer/__init__.py | 1 + addons/report_designer/__openerp__.py | 1 + addons/report_designer/res_config.py | 39 ++++++++++++++++++++++ addons/report_designer/res_config_view.xml | 34 +++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 addons/report_designer/res_config.py create mode 100644 addons/report_designer/res_config_view.xml diff --git a/addons/report_designer/__init__.py b/addons/report_designer/__init__.py index 9a3d6d2fbb6..53c45089ddc 100644 --- a/addons/report_designer/__init__.py +++ b/addons/report_designer/__init__.py @@ -19,5 +19,6 @@ # ############################################################################## +import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_designer/__openerp__.py b/addons/report_designer/__openerp__.py index f0559d8800c..69330a2a116 100644 --- a/addons/report_designer/__openerp__.py +++ b/addons/report_designer/__openerp__.py @@ -38,6 +38,7 @@ modules like base_report_designer and base_report_creator. 'init_xml': [], 'update_xml': [ 'security/ir.model.access.csv', + 'res_config_view.xml', ], 'demo_xml': [], 'installable': True, diff --git a/addons/report_designer/res_config.py b/addons/report_designer/res_config.py new file mode 100644 index 00000000000..62b9b48e453 --- /dev/null +++ b/addons/report_designer/res_config.py @@ -0,0 +1,39 @@ +# -*- 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 + +class report_configuration(osv.osv_memory): + _name = 'report.configuration' + _inherit = 'res.config.settings' + + _columns = { + 'module_base_report_designer': fields.boolean('Customise your OpenERP Report with OpenOffice', + help ="""It installs the base_report_designer module."""), + 'module_report_webkit': fields.boolean('Design OpenERP report in HTML', + help ="""It installs the report_webkit module."""), + 'module_report_webkit_sample': fields.boolean('Samples of HTML report design', + help ="""It installs the report_webkit_sample module."""), + } + +report_configuration() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/report_designer/res_config_view.xml b/addons/report_designer/res_config_view.xml new file mode 100644 index 00000000000..64e8aeb2e29 --- /dev/null +++ b/addons/report_designer/res_config_view.xml @@ -0,0 +1,34 @@ + + + + + Reporting Application + report.configuration + form + +
+ + + + + + + + + +
+
+ + + Configure Reporting Application + ir.actions.act_window + report.configuration + + form + form + + + + +
+
From 367d5c3fd908761d1881514ca3aa340654468f38 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 27 Mar 2012 18:57:21 +0530 Subject: [PATCH 004/129] [IMP] knowledge: add the field server_address_port and improve the code bzr revid: jap@tinyerp.com-20120327132721-a63fezw00ffkyzu2 --- addons/document/res_config.py | 53 ++++++++++++++++++++--------- addons/document/res_config_view.xml | 4 ++- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/addons/document/res_config.py b/addons/document/res_config.py index 7bf27ae91ec..e43d856880b 100644 --- a/addons/document/res_config.py +++ b/addons/document/res_config.py @@ -20,6 +20,8 @@ ############################################################################## from osv import fields, osv +from tools import config +from lxml import etree class knowledge_configuration(osv.osv_memory): _name = 'knowledge.configuration' @@ -27,28 +29,47 @@ class knowledge_configuration(osv.osv_memory): _columns = { 'module_wiki_quality_manual': fields.boolean('Use an internal wiki to group FAQ', - help =""" - It installs the wiki_quality_manual module. - """), + help ="""It installs the wiki_quality_manual module."""), 'module_wiki_faq': fields.boolean('Track quality with wiki', - help =""" - It install the wiki_faq. - """), + help ="""It install the wiki_faq."""), 'module_document_ftp': fields.boolean('Share repositories (FTP)', - help =""" - It install the document_ftp. - """), + help ="""It install the document_ftp."""), 'server_address_port': fields.char('Server address/IP and port',size=128, - help =""" - It assign server address/IP and port. - """), + help ="""It assign server address/IP and port."""), 'module_document_webdav': fields.boolean('Share Repositories (WebDAV)', - help =""" - It install the document_webdav. - """), + help ="""It install the document_webdav."""), } - + + _defaults = { + 'server_address_port': config.get('ftp_server_host', 'localhost') + ':' + config.get('ftp_server_port', '8021'), + } + + def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): + res = super(knowledge_configuration, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) + ir_module = self.pool.get('ir.module.module') + module_id= ir_module.search(cr, uid, [('name','=','document_ftp')]) + modle_state = ir_module.browse(cr,uid, module_id[0],context=context).state + doc = etree.XML(res['arch']) + nodes = doc.xpath("//field[@name='server_address_port']") + if modle_state == 'uninstalled': + for node in nodes: + node.set('invisible', '1') + res['arch'] = etree.tostring(doc) + return res + + def set_ftp_configurations(self, cr, uid, ids, context=None): + data_pool = self.pool.get('ir.model.data') + ir_module = self.pool.get('ir.module.module') + module_id= ir_module.search(cr, uid, [('name','=','document_ftp')]) + modle_state = ir_module.browse(cr,uid, module_id[0],context=context).state + if modle_state == 'installed': + conf = self.browse(cr, uid, ids[0], context=context) + doc_id = data_pool._get_id(cr, uid, 'document_ftp', 'action_document_browse') + doc_ids = data_pool.browse(cr, uid, doc_id, context=context).res_id + self.pool.get('ir.actions.url').write(cr, uid, [doc_ids], {'url': 'ftp://'+(conf.server_address_port or 'localhost:8021')+'/' + cr.dbname+'/'}) + return True + knowledge_configuration() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/document/res_config_view.xml b/addons/document/res_config_view.xml index 0794a9e8e86..3d96d0df9e0 100644 --- a/addons/document/res_config_view.xml +++ b/addons/document/res_config_view.xml @@ -1,6 +1,7 @@ + Knowledge Application knowledge.configuration @@ -16,6 +17,7 @@ + @@ -31,7 +33,7 @@ form - + From 93cc3b43e62c03a42b4d7e8022fd20378fd024f3 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Wed, 28 Mar 2012 12:04:59 +0530 Subject: [PATCH 005/129] [IMP] base_setup: add the configuration wizard bzr revid: jap@tinyerp.com-20120328063459-o4cnvnes8kd66xqz --- addons/base_setup/__init__.py | 1 + addons/base_setup/__openerp__.py | 2 +- addons/base_setup/res_config.py | 40 +++++++++++++++++++++++++++ addons/base_setup/res_config_view.xml | 37 +++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 addons/base_setup/res_config.py create mode 100644 addons/base_setup/res_config_view.xml diff --git a/addons/base_setup/__init__.py b/addons/base_setup/__init__.py index 82fe6ca3601..e425344e380 100644 --- a/addons/base_setup/__init__.py +++ b/addons/base_setup/__init__.py @@ -20,5 +20,6 @@ ############################################################################## import base_setup +import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_setup/__openerp__.py b/addons/base_setup/__openerp__.py index 093f2f492ff..360c7afbafc 100644 --- a/addons/base_setup/__openerp__.py +++ b/addons/base_setup/__openerp__.py @@ -36,7 +36,7 @@ Shows you a list of applications features to install from. 'website': 'http://www.openerp.com', 'depends': ['base'], 'init_xml': [], - 'update_xml': ['security/ir.model.access.csv', 'base_setup_views.xml' ], + 'update_xml': ['security/ir.model.access.csv', 'base_setup_views.xml','res_config_view.xml' ], 'demo_xml': [], 'installable': True, 'auto_install': True, diff --git a/addons/base_setup/res_config.py b/addons/base_setup/res_config.py new file mode 100644 index 00000000000..8829d8ef156 --- /dev/null +++ b/addons/base_setup/res_config.py @@ -0,0 +1,40 @@ +# -*- 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 + +class general_configuration(osv.osv_memory): + _name = 'general.configuration' + _inherit = 'res.config.settings' + + _columns = { + 'group_multi_company': fields.boolean('Active Multi company', + implied_group='base.group_multi_company', + help ="""It allow to set the multi company."""), + 'module_portal': fields.boolean('Customer Portal', + help ="""It installs the portal module."""), + 'module_share': fields.boolean('Share', + help ="""It installs the share module."""), + } + +general_configuration() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/base_setup/res_config_view.xml b/addons/base_setup/res_config_view.xml new file mode 100644 index 00000000000..ede184b9aaa --- /dev/null +++ b/addons/base_setup/res_config_view.xml @@ -0,0 +1,37 @@ + + + + + General Application + general.configuration + form + +
+ + +