diff --git a/addons/base_setup/res_config.py b/addons/base_setup/res_config.py index 5031a608099..8d0808a8870 100644 --- a/addons/base_setup/res_config.py +++ b/addons/base_setup/res_config.py @@ -56,4 +56,22 @@ class report_config_settings(osv.osv_memory): This installs the module report_webkit_sample."""), } + + +class knowledge_config_settings(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': fields.boolean('Full Document Indexing', + help="""It install the document."""), + 'module_document_ftp': fields.boolean('Share repositories (FTP)', + help="""It install the document_ftp."""), + 'module_document_webdav': fields.boolean('Share Repositories (WebDAV)', + help="""It install the document_webdav."""), + } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_setup/res_config_view.xml b/addons/base_setup/res_config_view.xml index a7a665f89ef..42378c11818 100644 --- a/addons/base_setup/res_config_view.xml +++ b/addons/base_setup/res_config_view.xml @@ -63,5 +63,41 @@ + + Configure Knowledge + knowledge.configuration + form + +
+
+
+ + + + + + + + + + + + + +
+
+
+ + + Configure Knowledge + knowledge.configuration + form + inline + + + diff --git a/addons/document_ftp/__init__.py b/addons/document_ftp/__init__.py index b86320f9909..7ba25cb0540 100644 --- a/addons/document_ftp/__init__.py +++ b/addons/document_ftp/__init__.py @@ -20,7 +20,7 @@ ############################################################################## import ftpserver import wizard - +import res_config post_load = ftpserver.start_server # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_ftp/__openerp__.py b/addons/document_ftp/__openerp__.py index c10cd913f56..f6ab4616b2d 100644 --- a/addons/document_ftp/__openerp__.py +++ b/addons/document_ftp/__openerp__.py @@ -40,7 +40,8 @@ FTP client. 'update_xml': [ 'wizard/ftp_configuration_view.xml', 'wizard/ftp_browse_view.xml', - 'security/ir.model.access.csv' + 'security/ir.model.access.csv', + 'res_config_view.xml', ], 'demo_xml': [], 'test': [ diff --git a/addons/document_ftp/res_config.py b/addons/document_ftp/res_config.py new file mode 100644 index 00000000000..724b59afafe --- /dev/null +++ b/addons/document_ftp/res_config.py @@ -0,0 +1,49 @@ +# -*- 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 +from tools import config + +class documnet_ftp_setting(osv.osv_memory): + _name = 'knowledge.configuration' + _inherit = 'knowledge.configuration' + _columns = { + 'url': fields.char('Browse Documents',size=64, + help ="""It allow to browse the document from the relative URL""", readonly=True), + } + + def get_default_ftp_config(self, cr, uid, ids, context=None): + ir_values = self.pool.get('ir.actions.url') + user_pool = self.pool.get('res.users') + current_user = user_pool.browse(cr, uid, uid, context=context) + data_pool = self.pool.get('ir.model.data') + aid = data_pool._get_id(cr, uid, 'document_ftp', 'action_document_browse') + aid = data_pool.browse(cr, uid, aid, context=context).res_id + ftp_url = self.pool.get('ir.actions.url').browse(cr, uid, aid, context=context) + url = ftp_url.url and ftp_url.url.split('ftp://') or [] + if url: + url = url[1] + if url[-1] == '/': + url = url[:-1] + else: + url = '%s:%s' %(ftpserver.HOST, ftpserver.PORT) + return {'url':'ftp://%s@%s'%(current_user.login, url)} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/document_ftp/res_config_view.xml b/addons/document_ftp/res_config_view.xml new file mode 100644 index 00000000000..159c0cf1025 --- /dev/null +++ b/addons/document_ftp/res_config_view.xml @@ -0,0 +1,18 @@ + + + + + Knowledge Application + knowledge.configuration + form + + + + + + + + + + +