From e58f289aebff7dabd37b72f8b4d334a89e4e9fd5 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Wed, 26 Mar 2014 14:04:17 +0100 Subject: [REM] move document_ftp to openerp-extra bzr revid: al@openerp.com-20140326130417-8226lcfoojop1j5e --- addons/document_ftp/wizard/__init__.py | 25 --------- addons/document_ftp/wizard/ftp_browse.py | 64 ---------------------- addons/document_ftp/wizard/ftp_browse_view.xml | 39 ------------- addons/document_ftp/wizard/ftp_configuration.py | 51 ----------------- .../document_ftp/wizard/ftp_configuration_view.xml | 44 --------------- 5 files changed, 223 deletions(-) delete mode 100644 addons/document_ftp/wizard/__init__.py delete mode 100644 addons/document_ftp/wizard/ftp_browse.py delete mode 100644 addons/document_ftp/wizard/ftp_browse_view.xml delete mode 100644 addons/document_ftp/wizard/ftp_configuration.py delete mode 100644 addons/document_ftp/wizard/ftp_configuration_view.xml (limited to 'addons/document_ftp/wizard') diff --git a/addons/document_ftp/wizard/__init__.py b/addons/document_ftp/wizard/__init__.py deleted file mode 100644 index 40997cc6b90..00000000000 --- a/addons/document_ftp/wizard/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- 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 . -# -############################################################################## -import ftp_browse -import ftp_configuration - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_ftp/wizard/ftp_browse.py b/addons/document_ftp/wizard/ftp_browse.py deleted file mode 100644 index ee8f897ca20..00000000000 --- a/addons/document_ftp/wizard/ftp_browse.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- 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 openerp.osv import fields, osv -# from openerp.tools.translate import _ -from .. import ftpserver - -class document_ftp_browse(osv.osv_memory): - _name = 'document.ftp.browse' - _description = 'Document FTP Browse' - - _columns = { - 'url' : fields.char('FTP Server', size=64, required=True), - } - - def default_get(self, cr, uid, fields, context=None): - res = {} - if 'url' in fields: - 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.act_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) - res['url'] = 'ftp://%s@%s'%(current_user.login, url) - return res - - def browse_ftp(self, cr, uid, ids, context=None): - data_id = ids and ids[0] or False - data = self.browse(cr, uid, data_id, context=context) - final_url = data.url - return { - 'type': 'ir.actions.act_url', - 'url':final_url, - 'target': 'new' - } - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_ftp/wizard/ftp_browse_view.xml b/addons/document_ftp/wizard/ftp_browse_view.xml deleted file mode 100644 index c1613b29a70..00000000000 --- a/addons/document_ftp/wizard/ftp_browse_view.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Document FTP Browse - document.ftp.browse - -
- - - -
-
-
-
-
- - - Document Browse - ir.actions.act_window - document.ftp.browse - - form - form - new - - - - -
-
diff --git a/addons/document_ftp/wizard/ftp_configuration.py b/addons/document_ftp/wizard/ftp_configuration.py deleted file mode 100644 index 1dee9495a95..00000000000 --- a/addons/document_ftp/wizard/ftp_configuration.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- 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 openerp.osv import fields, osv -from openerp.tools import config - -class document_ftp_configuration(osv.osv_memory): - - _name='document.ftp.configuration' - _description = 'Auto Directory Configuration' - _inherit = 'res.config' - _rec_name = 'host' - _columns = { - 'host': fields.char('Address', size=64, - help="Server address or IP and port to which users should connect to for DMS access", - required=True), - } - - _defaults = { - 'host': config.get('ftp_server_host', 'localhost') + ':' + config.get('ftp_server_port', '8021'), - } - - def execute(self, cr, uid, ids, context=None): - conf = self.browse(cr, uid, ids[0], context=context) - data_pool = self.pool.get('ir.model.data') - # Update the action for FTP browse. - aid = data_pool._get_id(cr, uid, 'document_ftp', 'action_document_browse') - aid = data_pool.browse(cr, uid, aid, context=context).res_id - self.pool.get('ir.actions.act_url').write(cr, uid, [aid], - {'url': 'ftp://'+(conf.host or 'localhost:8021')+'/' + cr.dbname+'/'}) - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_ftp/wizard/ftp_configuration_view.xml b/addons/document_ftp/wizard/ftp_configuration_view.xml deleted file mode 100644 index 9e05fba986e..00000000000 --- a/addons/document_ftp/wizard/ftp_configuration_view.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Browse Files - ftp://localhost:8021/ - - - - - - FTP Server Configuration - document.ftp.configuration - - - -
- Knowledge Application Configuration -
- - - -
-
-
- - - FTP Server Configuration - ir.actions.act_window - document.ftp.configuration - - form - form - new - - - - - automatic - -
-
-- cgit v1.2.3