diff --git a/external_file_location/__openerp__.py b/external_file_location/__openerp__.py index e2b4624f..b485d0d0 100644 --- a/external_file_location/__openerp__.py +++ b/external_file_location/__openerp__.py @@ -2,8 +2,8 @@ ############################################################################### # # Module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com). -# @author Sébastien BEAU +# Copyright (C) 2015 Akretion (http://www.akretion.com). +# @author Valentin CHEMIERE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -20,27 +20,25 @@ # ############################################################################### -{'name': 'external_file_location', +{ + 'name': 'external_file_location', 'version': '0.0.1', 'author': 'Akretion', 'website': 'www.akretion.com', 'license': 'AGPL-3', 'category': 'Generic Modules', 'description': """ - + File exchange system with multiple protocol (SFTP, FTP, Filestore) """, 'depends': [ 'base', ], 'data': [ 'attachment_view.xml', + 'menu.xml', 'location_view.xml', 'task_view.xml', ], 'installable': True, 'application': True, } - - - - diff --git a/external_file_location/helper.py b/external_file_location/helper.py index ad5fd0a8..3e0b93a6 100644 --- a/external_file_location/helper.py +++ b/external_file_location/helper.py @@ -1,24 +1,24 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Copyright (C) 2014 initOS GmbH & Co. KG (). +# Author: Joel Grand-Guillaume +# Copyright 2011-2012 Camptocamp SA # -# 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 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. +# 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 . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # ############################################################################## - def itersubclasses(cls, _seen=None): """ itersubclasses(cls) diff --git a/external_file_location/location.py b/external_file_location/location.py index 74ef9eef..07555b68 100644 --- a/external_file_location/location.py +++ b/external_file_location/location.py @@ -2,8 +2,8 @@ ############################################################################### # # Module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com). -# @author Sébastien BEAU +# Copyright (C) 2015 Akretion (http://www.akretion.com). +# @author Valentin CHEMIERE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/external_file_location/location_view.xml b/external_file_location/location_view.xml index 71adbf82..c3fed2ce 100644 --- a/external_file_location/location_view.xml +++ b/external_file_location/location_view.xml @@ -44,7 +44,7 @@ diff --git a/external_file_location/menu.xml b/external_file_location/menu.xml new file mode 100644 index 00000000..553ae688 --- /dev/null +++ b/external_file_location/menu.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/external_file_location/task.py b/external_file_location/task.py index 3cbf9994..d6352298 100644 --- a/external_file_location/task.py +++ b/external_file_location/task.py @@ -34,6 +34,7 @@ class Task(models.Model): filename = fields.Char() filepath = fields.Char() location_id = fields.Many2one('external.file.location', string='Location') + attachment_id = fields.Many2one('ir.attachment', string='Attachment') def _get_method(self): res = [] @@ -57,8 +58,8 @@ class Task(models.Model): 'port': self.location_id.port, 'allow_dir_creation': False, 'file_name': self.filename, - 'path': self.filepath + 'path': self.filepath, + 'attachment_id': self.attachment_id, } conn = method_class(self.env, config) - file_id = conn.run() - + conn.run() diff --git a/external_file_location/task_view.xml b/external_file_location/task_view.xml index ddbfded9..f0e54343 100644 --- a/external_file_location/task_view.xml +++ b/external_file_location/task_view.xml @@ -13,6 +13,7 @@ +