From bf9321e7156d8c859720e19d912db69b67c1d148 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 13:53:14 +0530 Subject: [PATCH] [REM] document email module removed => unused bzr revid: mra@mra-laptop-20101015082314-zrh1yod9qth1twa6 --- addons/document_email/__init__.py | 24 ----- addons/document_email/__openerp__.py | 44 --------- addons/document_email/document_email.py | 115 ----------------------- addons/document_email/document_email.xml | 97 ------------------- 4 files changed, 280 deletions(-) delete mode 100644 addons/document_email/__init__.py delete mode 100644 addons/document_email/__openerp__.py delete mode 100644 addons/document_email/document_email.py delete mode 100644 addons/document_email/document_email.xml diff --git a/addons/document_email/__init__.py b/addons/document_email/__init__.py deleted file mode 100644 index 40d4f14c4d1..00000000000 --- a/addons/document_email/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# fp@tinyerp.com -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - -import document_email diff --git a/addons/document_email/__openerp__.py b/addons/document_email/__openerp__.py deleted file mode 100644 index 0348665ffa0..00000000000 --- a/addons/document_email/__openerp__.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# fp@tinyerp.com -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - "name" : "Email Integrated Document", - "version" : "1.1", - "depends" : ["base", "document", "fetchmail","mail_gateway"], - "author" : "Tiny", - "description": """Email Integrated Document - * Email based Document submission - * user based document submission - """, - 'author': 'OpenERP SA', - 'website': 'http://www.openerp.com', - 'init_xml': [], - 'update_xml': [ - "document_email.xml" - ], - 'demo_xml': [ - - ], - 'installable': True, - 'active': False -} diff --git a/addons/document_email/document_email.py b/addons/document_email/document_email.py deleted file mode 100644 index e4e94fa6c1f..00000000000 --- a/addons/document_email/document_email.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# fp@tinyerp.com -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - -import os -import binascii - -import netsvc - -from osv import osv -from osv import fields -from tools.translate import _ - -logger = netsvc.Logger() - -class email_to_document(osv.osv): - - _name = 'document.email' - _description = "Emails to Documents Gateway" - - _columns = { - 'name':fields.char('Name', size=64, required=True, readonly=False), - 'user_id':fields.many2one('res.users', 'User', required=True), - 'directory_id':fields.many2one('document.directory', 'Directory', required=True), - 'accept_files':fields.char('File Extension', size=1024, required=True), - 'note': fields.text('Description'), - 'server_id': fields.many2one('email.server',"Mail Server", select=True), - } - - _defaults = { - 'accept_files': lambda *a: "['.txt', '.ppt', '.doc', '.xls', '.pdf', '.jpg', '.png']", - 'user_id': lambda self, cr, uid, ctx: uid, - } - - _sql_constraints = [ - ('name_uniq', 'unique (user_id, server_id)', 'You can not configure one serve for multiple directory !'), - ] - - def message_new(self, cr, uid, msg, context): - """ - Automatically calls when new email message arrives - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks - """ - server_id = context.get('server_id', False) - file_pool = self.pool.get('ir.attachment') - if server_id: - ids = self.search(cr, uid, [('server_id', '=', server_id)]) - dr = self.browse(cr, uid, ids[0]) - id = dr.directory_id.id - - partner = self.pool.get('email.server.tools').get_partner(cr, uid, msg.get('from'), context) - ext = eval(dr.accept_files, {}) - attachents = msg.get('attachments', []) - - for attactment in attachents: - file_ext = os.path.splitext(attactment) - if file_ext[1] not in ext: - logger.notifyChannel('document', netsvc.LOG_WARNING, 'file type %s is not allows to process for directory %s' % (file_ext[1], dr.directory_id.name)) - continue - - data_attach = { - 'name': attactment, - 'datas':binascii.b2a_base64(str(attachents.get(attactment))), - 'datas_fname': attactment, - 'description': msg.get('body', 'Mail attachment'), - 'parent_id': id, - 'partner_id':partner.get('partner_id', False), - 'res_model': 'document.directory', - 'res_id': id, - } - file_pool.create(cr, uid, data_attach) - - return id - return 0 - - def message_update(self, cr, uid, ids, vals={}, msg="", default_act=None, context={}): - """ - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of update mail’s IDs - """ - logger.notifyChannel('document', netsvc.LOG_WARNING, 'method not implement to keep multipe version of file') - return True -email_to_document() - -class document_directory(osv.osv): - _inherit = 'document.directory' - - _columns = { - 'email_ids':fields.one2many('document.email', 'directory_id', 'Document to Email', required=False), - } -document_directory() diff --git a/addons/document_email/document_email.xml b/addons/document_email/document_email.xml deleted file mode 100644 index 5509d6e8cfb..00000000000 --- a/addons/document_email/document_email.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - document.directory - document.directory - form - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- - - document.email.tree - document.email - tree - - - - - - - - - - - document.email.form - document.email - form - -
- - - - - - - - - - - - - - - - - - - -
-
-
- - - Email to Document - document.email - form - tree,form - - {} - [] - - -
-