Commit 80cfce7e authored by fedexin40's avatar fedexin40

Deleted deprecated module

parent 6d251b2a
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
############################################################################
# Coded by: el_rodo_1 (rodo@vauxoo.com)
############################################################################
#
# 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 upload_ftp
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
############################################################################
# Coded by: el_rodo_1 (rodo@vauxoo.com)
############################################################################
#
# 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" : "Upload ftp",
"version" : "1.0",
"author" : "Vauxoo",
"category" : "Localization/Mexico",
"description" : """This module upload files attachment to ftp""",
"website" : "http://www.vauxoo.com/",
"license" : "AGPL-3",
"depends" : ["base"],
"init_xml" : [],
"demo_xml" : [],
"update_xml" : ["upload_ftp_view.xml"],
"installable" : True,
"active" : False,
}
# Spanish translation for openerp-mexico-localization
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openerp-mexico-localization package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-mexico-localization\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-11-08 03:15+0000\n"
"PO-Revision-Date: 2013-11-12 03:33+0000\n"
"Last-Translator: Federico Manuel Echeverri Choux <echeverrifm@gmail.com>\n"
"Language-Team: Spanish <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-02-14 07:51+0000\n"
"X-Generator: Launchpad (build 16916)\n"
#. module: l10n_mx_upload_ftp
#: view:ftp.server:0
#: field:ftp.server,name:0
#: model:ir.actions.act_window,name:l10n_mx_upload_ftp.action_ftp_server_form
#: model:ir.ui.menu,name:l10n_mx_upload_ftp.ftp_server_view
msgid "ftp server"
msgstr "Servidor ftp"
#. module: l10n_mx_upload_ftp
#: model:ir.ui.menu,name:l10n_mx_upload_ftp.ftp_server_menu
msgid "ftp Server"
msgstr "Servidor ftp"
#. module: l10n_mx_upload_ftp
#: field:ftp.server,ftp_source:0
msgid "ftp source"
msgstr "origen del ftp"
#. module: l10n_mx_upload_ftp
#: field:ftp.server,ftp_pwd:0
msgid "ftp pwd"
msgstr "Contraseña del ftp"
#. module: l10n_mx_upload_ftp
#: model:ir.model,name:l10n_mx_upload_ftp.model_ir_attachment
msgid "ir.attachment"
msgstr "ir.attachment"
#. module: l10n_mx_upload_ftp
#: help:ftp.server,ftp_source:0
msgid "Format example \"/done\""
msgstr "Formato de ejemplo \"/done\""
#. module: l10n_mx_upload_ftp
#: model:ir.model,name:l10n_mx_upload_ftp.model_ftp_server
msgid "ftp.server"
msgstr "ftp.server"
#. module: l10n_mx_upload_ftp
#: field:ftp.server,ftp_user:0
msgid "ftp user"
msgstr "Usuario ftp"
id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_res_user_ftp_server ftp.sever model_ftp_server 1 1 1 1
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
############################################################################
# Coded by: el_rodo_1 (rodo@vauxoo.com)
############################################################################
#
# 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 openerp.osv import fields, orm
from openerp.tools import pooler
from openerp.tools.translate import _
from openerp import release
import ftplib
import os
import tempfile
import base64
class ir_attachment(orm.Model):
_inherit = 'ir.attachment'
def binary2file(self, cr, uid, ids, binary_data, file_prefix="", file_suffix=""):
(fileno, fname) = tempfile.mkstemp(file_suffix, file_prefix)
f = open(fname, 'wb')
f.write(base64.decodestring(binary_data))
f.close()
os.close(fileno)
return fname
def file_ftp(self, cr, uid, ids, context=None):
if context is None:
context = {}
ftp_id = False
ftp_obj = pooler.get_pool(cr.dbname).get('ftp.server')
ftp_id = ftp_obj.search(cr, uid, [('name', '!=', False)], context=None)
if not ftp_id:
raise orm.except_orm(
_('Error Servidor ftp!'),
_('No Existe Servidor ftp Configurado')
)
ftp = ftp_obj.browse(cr, uid, ftp_id, context)[0]
ftp_server = ftp.name
ftp_user = ftp.ftp_user
ftp_pwd = ftp.ftp_pwd
ftp_source = ftp.ftp_source
list_files = []
for id_file in ids:
if id_file:
atta_brw = self.browse(cr, uid, [id_file], context)[0]
if release.version < '6':
file_binary = atta_brw.datas
else:
file_binary = base64.encodestring(atta_brw.db_datas)
file = self.binary2file(
cr, uid, id_file, file_binary, "ftp", "")
file_name = atta_brw.datas_fname
list_files.append({'source_file': file, 'name': file_name})
for a in list_files:
try:
s = ftplib.FTP(ftp_server, ftp_user, ftp_pwd)
f = open((a['source_file']), 'rb')
s.cwd(ftp_source)
s.storbinary('STOR ' + (a['name'].replace('/', '_')), f)
f.close()
s.quit()
except:
raise orm.except_orm(
_('Error ftp Configuration!'),
_('Check ftp Server Information')
)
return True
class ftp_server(orm.Model):
_name = 'ftp.server'
_columns = {
'name': fields.char('ftp server', size=128, required=True),
'ftp_user': fields.char('ftp user', size=128, required=True),
'ftp_pwd': fields.char('ftp pwd', size=128, required=True),
'ftp_source': fields.char('ftp source', size=128, required=True,
help='Format example "/done"'),
}
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_ftp_server_form" model="ir.ui.view">
<field name="name">view.ftp.server.form</field>
<field name="model">ftp.server</field>
<field name="arch" type="xml">
<form string="ftp server">
<field name='name' />
<field name='ftp_user'/>
<field name='ftp_source'/>
<field name='ftp_pwd' password="True"/>
</form>
</field>
</record>
<record id="view_ftp_server_tree" model="ir.ui.view">
<field name="name">view.ftp.server.tree</field>
<field name="model">ftp.server</field>
<field name="arch" type="xml">
<tree string="ftp server">
<field name='name' />
<field name='ftp_user'/>
<field name='ftp_source'/>
<field name='ftp_pwd' password="True"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_ftp_server_form">
<field name="name">ftp server</field>
<field name="res_model">ftp.server</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="limit">80</field>
</record>
<menuitem id="ftp_server_menu" name="ftp Server" parent="base.menu_administration" sequence="1"/>
<menuitem
id="ftp_server_view"
name="ftp server"
action="action_ftp_server_form"
parent="ftp_server_menu"/>
</data>
</openerp>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment