Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
8de978b
[ADD] add file-email
sebastienbeau Apr 3, 2013
140fa02
[FIX] fix module name
bguillot Apr 3, 2013
658e0d3
[REF] refactor file email
sebastienbeau Apr 4, 2013
82f4c94
[FIX] fix Model -> orm.Model
bguillot Apr 5, 2013
ee1ec85
[PORT] port view to v7
bguillot Apr 7, 2013
548e308
[IMP] file_email: fix default value, add company on email server, add…
sebastienbeau Jul 10, 2013
4af45fc
Add a missing dependency to fetchmail
Aug 8, 2013
97b8e20
[FIX] fix missing dependency
sebastienbeau Sep 4, 2013
4e67654
[FIX] fix email import for V7
sebastienbeau Nov 26, 2013
4699718
[MERGE] merge various improvement, look in the log of the branch merg…
sebastienbeau Dec 5, 2013
8e691f8
[IMP] Add possibility to create condition in the fetchmail server whi…
florian-dacosta Dec 13, 2013
220881d
[FIX] fix import of email. We have to call super with the server_id a…
sebastienbeau Dec 16, 2013
1396b72
[REF] Refactore prepare data for file document function + clear some …
florian-dacosta Dec 17, 2013
7a03c0c
[IMP] Add required to mail and subject fields in file.document.condit…
florian-dacosta Dec 17, 2013
61a9078
[MERGE] merge condition parser for import attachment from email
florian-dacosta Jan 6, 2014
f935def
[FIX] Change condition on the mail object for more flexibility
florian-dacosta Jan 30, 2014
e7139d3
[FIX] fix empty data when saving an attachment
florian-dacosta Jan 30, 2014
9527404
[FIX] passing the file_type was missing
sebastienbeau Mar 25, 2014
01a9e55
puts profile on email condition instead of fetchmail server
florian-dacosta Dec 15, 2014
01316a4
Initial commit
Feb 18, 2015
2fa7baf
First commit Work in Progress
Feb 18, 2015
8173c75
Update readme
Feb 18, 2015
1a8e242
Module name
Feb 18, 2015
1071c16
Remove old module ir_exchange_file/task_view.xml
Feb 18, 2015
6fc9c12
Delete vim swap files
Feb 18, 2015
6732a07
WIP
Feb 19, 2015
af6f43c
WIP reprise du fichier ftp du projet connector_flow https://github.co…
Feb 20, 2015
193465c
FTP import working with subclass discovery
Feb 24, 2015
2f87d70
Export working and new menu
Feb 25, 2015
afa5dc4
Change README
Feb 25, 2015
8d38f72
Dedicated tree for attachments, some view tweaks and renaming task
Feb 26, 2015
0fbb3be
attachment kanban view in first
Feb 26, 2015
b39b495
Cron working, refactoring relation task/attachment wip
Mar 2, 2015
277cd20
One task could have multiple attachment to handle
Mar 4, 2015
dec1aff
Improve interface
Mar 5, 2015
d9479ea
Can move or delete file after import, md5 verification OK
Mar 10, 2015
954bad5
Task view improvement
Mar 11, 2015
99b3a63
Update readme
Mar 11, 2015
3fc73f7
Merge remote-tracking branch 'ir_attachment_exchange/master' into 8.0…
Mar 11, 2015
0e55fb7
Add ftputil to travis file
Mar 12, 2015
82ab470
Relative import
Mar 12, 2015
375e6b4
[FIX] fix right on file, use 644 by default
sebastienbeau Mar 12, 2015
9cfa8fa
Some errors at install
Mar 12, 2015
f5d264b
Pep8 and xml indentation
Mar 12, 2015
1cfaf44
Reworking of some methods and views
Mar 13, 2015
a23f151
Flake8 fix
Mar 16, 2015
0f9fc06
Flake8 fix
Mar 16, 2015
4ddfa79
flake8 fix
Mar 16, 2015
f2d71fc
Polymorphic inherit for ir.attachment
Mar 16, 2015
07ec43b
Fix readme and add security files
Mar 16, 2015
8b86e15
Add sftp protocol
Mar 17, 2015
ff3c273
Fix flake8
Mar 17, 2015
5f9e5b1
Refactoring, migration to fs lib and add local storage protocol
Mar 17, 2015
2c461fd
Fix flake8
Mar 18, 2015
6ba509d
Update travis file
Mar 18, 2015
70e61d0
Fix flake8
Mar 18, 2015
e5bccd8
Fix external dependencies
Mar 18, 2015
3b24b6a
Change module name
Mar 18, 2015
16ca5d5
Change module name
Mar 18, 2015
da3e3ad
FIx bugs and tweak view
Mar 18, 2015
1229793
fix flake8
Mar 19, 2015
72ba486
FIx flake8
Mar 19, 2015
ae53347
Fix flake8
Mar 19, 2015
20204c4
Move into file_email directory
Mar 19, 2015
1abf620
Merge remote-tracking branch 'file_email/7.0' into 8.0-external_file_…
Mar 19, 2015
9330dcd
Functionnal on 8.0 server instance with external_file_location, working
Mar 19, 2015
0932cb1
Migration from v7 api to v8 api done, working on pep8 now
Mar 24, 2015
f40146b
Flake8 done
Mar 24, 2015
0bf03f9
Pylint fix
Mar 25, 2015
39901ad
Remove invalid docstrings
Mar 25, 2015
ce4edf9
Add test with mock server
Apr 24, 2015
6e9e9ff
Suppression rope
Apr 24, 2015
ade3a27
Fix flake8
Apr 27, 2015
7858aee
Delete rope files
Apr 27, 2015
3a9991d
relative import
Apr 27, 2015
ae437c4
Fix flake8
Apr 27, 2015
91fbe16
Debug test
Apr 27, 2015
23003e8
Debug test
Apr 27, 2015
693c723
Remove file
Jun 17, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
- sudo pip install paramiko
- sudo pip install fs


script:
Expand Down
51 changes: 51 additions & 0 deletions attachment_metadata/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License

Attachment Metadata
======================

This module was written to extend the functionality of ir.attachment

Installation
============

Installable without any requirements

Usage
=====

THe module just add some field to ir.attachment

For further information, please visit:

* https://www.odoo.com/forum/help-1

Known issues / Roadmap
======================

Credits
=======

* Joel Grand-Guillaume Camptocamp
* initOS <http://initos.com>
* Valentin CHEMIERE <valentin.chemiere@akretion.com>

Contributors
------------

* Sebastien BEAU <sebastian.beau@akretion.com>

Maintainer
----------

* Valentin CHEMIERE <valentin.chemiere@akretion.com>

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
23 changes: 23 additions & 0 deletions attachment_metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Module for OpenERP
# Copyright (C) 2015 Akretion (http://www.akretion.com).
# @author Valentin CHEMIERE <valentin.chemiere@akretion.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 . import attachment
43 changes: 43 additions & 0 deletions attachment_metadata/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Module for OpenERP
# Copyright (C) 2015 Akretion (http://www.akretion.com).
# @author Valentin CHEMIERE <valentin.chemiere@akretion.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': 'attachment_metadata',
'version': '0.0.1',
'author': 'Akretion',
'website': 'www.akretion.com',
'license': 'AGPL-3',
'category': 'Generic Modules',
'description': """
Add some useful field to ir.attachment object like:
internal and external hash for coherence verification
""",
'depends': [
'base',
'mail'
],
'data': [
'attachment_view.xml',
'security/ir.model.access.csv',
],
'installable': True,
'application': False,
}
47 changes: 47 additions & 0 deletions attachment_metadata/attachment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Module for OpenERP
# Copyright 2011-2012 Camptocamp SA
# @author: Joel Grand-Guillaume
# Copyright (C) 2015 Akretion (http://www.akretion.com).
# @author Valentin CHEMIERE <valentin.chemiere@akretion.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 import models, fields, api, _
from openerp.exceptions import Warning
import hashlib
from base64 import b64decode


class IrAttachmentMetadata(models.Model):
_name = 'ir.attachment.metadata'
_inherits = {'ir.attachment': 'attachment_id'}

internal_hash = fields.Char(store=True, compute='_compute_hash')
external_hash = fields.Char()
attachment_id = fields.Many2one('ir.attachment', required=True,
ondelete='cascade')

@api.depends('datas', 'external_hash')
def _compute_hash(self):
if self.datas:
self.internal_hash = hashlib.md5(b64decode(self.datas)).hexdigest()
if self.external_hash and self.internal_hash != self.external_hash:
raise Warning(_('File corrupted'),
_("Something was wrong with the retreived file, "
"please relaunch the task."))
17 changes: 17 additions & 0 deletions attachment_metadata/attachment_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>

<record id="view_attachment_improved_form" model="ir.ui.view">
<field name="model">ir.attachment.metadata</field>
<field name="inherit_id" ref="base.view_attachment_form" />
<field name="arch" type="xml">
<field name="url" position="after">
<field name="internal_hash"/>
<field name="external_hash"/>
</field>
</field>
</record>

</data>
</openerp>
2 changes: 2 additions & 0 deletions attachment_metadata/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_attachment_metadata_user,ir.attachment.metadata.user,model_ir_attachment_metadata,base.group_user,1,0,0,0
59 changes: 59 additions & 0 deletions external_file_location/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License

External File Location
======================

This module was written to extend the functionality of ir.attachment to support remote communication and allow you to import/export file to a remote server

Installation
============

To install this module, you need to:

* fs python module
* Paramiko python module

Usage
=====

To use this module, you need to:

* Add a location with your server infos
* Create a task with your file info and remote communication method
* A cron task will trigger each task

For further information, please visit:

* https://www.odoo.com/forum/help-1

Known issues / Roadmap
======================


Credits
=======

* Joel Grand-Guillaume Camptocamp
* initOS <http://initos.com>
* Valentin CHEMIERE <valentin.chemiere@akretion.com>

Contributors
------------

* Sebastien BEAU <sebastian.beau@akretion.com>

Maintainer
----------

* Valentin CHEMIERE <valentin.chemiere@akretion.com>

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
27 changes: 27 additions & 0 deletions external_file_location/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.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 . import attachment
from . import location
from . import task
from . import tasks
from . import tests
49 changes: 49 additions & 0 deletions external_file_location/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Module for OpenERP
# Copyright (C) 2015 Akretion (http://www.akretion.com).
# @author Valentin CHEMIERE <valentin.chemiere@akretion.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': 'external_file_location',
'version': '0.0.1',
'author': 'Akretion',
'website': 'www.akretion.com',
'license': 'AGPL-3',
'category': 'Generic Modules',
'depends': [
'attachment_metadata',
],
'external_dependencies': {
'python': [
'fs',
'paramiko',
],
},
'data': [
'menu.xml',
'attachment_view.xml',
'location_view.xml',
'task_view.xml',
'cron.xml',
'security/ir.model.access.csv',
],
'installable': True,
'application': True,
}
26 changes: 26 additions & 0 deletions external_file_location/abstract_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from base64 import b64encode


class AbstractTask(object):

_name = None
_key = None
_synchronize_type = None
_default_port = None
_hide_login = False
_hide_password = False
_hide_port = False

def create_file(self, filename, data):
ir_attachment_id = self.env['ir.attachment.metadata'].create({
'name': filename,
'datas': b64encode(data),
'datas_fname': filename,
'task_id': self.task and self.task.id or False,
'location_id': self.task and self.task.location_id.id or False,
'external_hash': self.ext_hash
})
return ir_attachment_id
Loading