[IMP] document: remove ftp Integration from document and make seperate module for FTP Integration

bzr revid: hmo@tinyerp.com-20091217084214-6mve0dt68u8jdded
This commit is contained in:
Harry (Open ERP) 2009-12-17 14:12:14 +05:30
parent 575035a205
commit ad5882ec42
14 changed files with 137 additions and 57 deletions

View File

@ -25,8 +25,6 @@ import document_storage
import document_directory
import directory_content
import directory_report
import doc_conf_wizard
import document
import ftpserver
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,8 +24,7 @@
'name': 'Integrated Document Management System',
'version': '1.99',
'category': 'Generic Modules/Others',
'description': """This is a complete document management system:
* FTP Interface
'description': """This is a complete document management system:
* User Authentication
* Document Indexation
""",

View File

@ -146,19 +146,7 @@
<menuitem
action="action_document_directory_tree"
id="menu_document_directories_tree"
parent="menu_document_configuration"/>
<record model="ir.actions.url" id="action_document_browse">
<field name="name">Browse Files</field>
<field name="url">ftp://localhost:8021/</field>
</record>
<menuitem
name="Browse Files Using FTP"
action="action_document_browse"
id="menu_document_browse"
type="url"
icon="STOCK_EXECUTE"
parent="menu_document"/>
parent="menu_document_configuration"/>
<record model="ir.ui.view" id="view_document_file_form">
<field name="name">ir.attachment</field>
@ -301,42 +289,7 @@
</field>
</field>
</record>
<record id="view_auto_config_form" model="ir.ui.view">
<field name="name">Auto Configure Directory</field>
<field name="model">document.configuration.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Auto Configure">
<separator string="Document Management System." colspan="4"/>
<label string="This wizard will automatically configure the document management system according to modules installed on your system." align="0.0" colspan="4"/>
<field name="host" colspan="4"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_config" string="Configure" icon='gtk-ok' type="object"/>
</group>
</form>
</field>
</record>
<record id="action_config_auto_directory" model="ir.actions.act_window">
<field name="name">Auto Configure Directory</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.configuration.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.actions.todo" id="config_auto_directory">
<field name="name">Auto Configure Directory</field>
<field name="note">This wizard will configure the URL of the server of the document management system.</field>
<field name="action_id" ref="action_config_auto_directory"/>
</record>
<act_window domain="[('partner_id', '=', active_id)]"
id="act_res_partner_document" name="Related Documents"
res_model="ir.attachment"

View File

@ -104,6 +104,10 @@ class node_class(object):
self.displayname = 'Object'
def full_path(self):
""" Return the components of the full path for some
node.
The returned list only contains the names of nodes.
"""
if self.parent:
s = self.parent.full_path()
else:
@ -112,7 +116,7 @@ class node_class(object):
s+=self.path
else:
s.append(self.path)
return map(lambda x: '/' +x, s)
return s #map(lambda x: '/' +x, s)
def children(self, cr):
print "node_class.children()"

View File

@ -5,7 +5,5 @@
"access_document_directory_content_all","document.directory.content all","model_document_directory_content",,1,0,0,0
"access_document_directory_content_group_document_manager","document.directory.content document manager","model_document_directory_content","group_document_manager",1,1,1,1
"access_document_directory_content_group_system","document.directory.content group system","model_document_directory_content","base.group_system",1,1,1,1
"access_document_configuation_wizard","document.configuration.wizard document manager","model_document_configuration_wizard","group_document_manager",1,1,1,1
"access_document_configuation_wizard_sytem","document.configuration.wizard group system","model_document_configuration_wizard","base.group_system",1,1,1,1
"access_document_directory_content_type_group_document_manager","document.directory.content.type document manager","model_document_directory_content_type","group_document_manager",1,1,1,1
"access_document_directory_content_type_group_system","document.directory.content.type group system","model_document_directory_content_type","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_document_directory_content_all document.directory.content all model_document_directory_content 1 0 0 0
6 access_document_directory_content_group_document_manager document.directory.content document manager model_document_directory_content group_document_manager 1 1 1 1
7 access_document_directory_content_group_system document.directory.content group system model_document_directory_content base.group_system 1 1 1 1
access_document_configuation_wizard document.configuration.wizard document manager model_document_configuration_wizard group_document_manager 1 1 1 1
access_document_configuation_wizard_sytem document.configuration.wizard group system model_document_configuration_wizard base.group_system 1 1 1 1
8 access_document_directory_content_type_group_document_manager document.directory.content.type document manager model_document_directory_content_type group_document_manager 1 1 1 1
9 access_document_directory_content_type_group_system document.directory.content.type group system model_document_directory_content_type base.group_user 1 0 0 0

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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/>.
#
##############################################################################
import doc_conf_wizard
import ftpserver
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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/>.
#
##############################################################################
{
'name': 'Integrated FTP Server with Document Management System',
'version': '1.99',
'category': 'Generic Modules/Others',
'description': """This is a support FTP Interface with document management system:
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base', 'document'],
'init_xml': [],
'update_xml': [
'document_ftp_view.xml',
'security/ir.model.access.csv'
],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': None,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,56 @@
<openerp>
<data>
<record model="ir.actions.url" id="action_document_browse">
<field name="name">Browse Files</field>
<field name="url">ftp://localhost:8021/</field>
</record>
<menuitem
name="Browse Files Using FTP"
action="action_document_browse"
id="menu_document_browse"
type="url"
icon="STOCK_EXECUTE"
parent="document.menu_document"/>
<record id="view_auto_config_form" model="ir.ui.view">
<field name="name">Auto Configure Directory</field>
<field name="model">document.configuration.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Auto Configure">
<separator string="Document Management System." colspan="4"/>
<label string="This wizard will automatically configure the document management system according to modules installed on your system." align="0.0" colspan="4"/>
<field name="host" colspan="4"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_config" string="Configure" icon='gtk-ok' type="object"/>
</group>
</form>
</field>
</record>
<record id="action_config_auto_directory" model="ir.actions.act_window">
<field name="name">Auto Configure Directory</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.configuration.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.actions.todo" id="config_auto_directory">
<field name="name">Auto Configure Directory</field>
<field name="note">This wizard will configure the URL of the server of the document management system.</field>
<field name="action_id" ref="action_config_auto_directory"/>
</record>
</data>
</openerp>

View File

@ -205,7 +205,9 @@ class abstracted_fs:
def fs2ftp(self, node):
res='/'
if node:
res = os.path.normpath(''.join(node.full_path()))
paths = node.full_path()
paths = map(lambda x: '/' +x, paths)
res = os.path.normpath(''.join(paths))
res = res.replace("\\", "/")
while res[:2] == '//':
res = res[1:]

View File

@ -0,0 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_document_configuation_wizard","document.configuration.wizard document manager","model_document_configuration_wizard","document.group_document_manager",1,1,1,1
"access_document_configuation_wizard_sytem","document.configuration.wizard group system","model_document_configuration_wizard","base.group_system",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_document_configuation_wizard document.configuration.wizard document manager model_document_configuration_wizard document.group_document_manager 1 1 1 1
3 access_document_configuation_wizard_sytem document.configuration.wizard group system model_document_configuration_wizard base.group_system 1 1 1 1