diff --git a/external_file_location/__openerp__.py b/external_file_location/__openerp__.py index 57c4ba35..04c1063f 100644 --- a/external_file_location/__openerp__.py +++ b/external_file_location/__openerp__.py @@ -32,6 +32,7 @@ """, 'depends': [ 'base', + 'ir_attachment_metadata', ], 'data': [ 'attachment_view.xml', diff --git a/external_file_location/abstract_task.py b/external_file_location/abstract_task.py index 13eae0cc..c9397318 100755 --- a/external_file_location/abstract_task.py +++ b/external_file_location/abstract_task.py @@ -13,7 +13,8 @@ class AbstractTask(object): 'datas': b64encode(data), 'datas_fname': filename, 'task_id': self.task.id, - 'location_id': self.task.location_id.id + 'location_id': self.task.location_id.id, + 'external_hash': self.ext_hash } ) return ir_attachment_id diff --git a/external_file_location/attachment_view.xml b/external_file_location/attachment_view.xml index 640b4819..d545c346 100644 --- a/external_file_location/attachment_view.xml +++ b/external_file_location/attachment_view.xml @@ -25,8 +25,6 @@ - - diff --git a/external_file_location/task.py b/external_file_location/task.py index af190eba..f40bdb34 100644 --- a/external_file_location/task.py +++ b/external_file_location/task.py @@ -36,6 +36,9 @@ class Task(models.Model): location_id = fields.Many2one('external.file.location', string='Location') attachment_ids = fields.One2many('ir.attachment', 'task_id', string='Attachment') + delete_file = fields.Boolean(string='Delete file') + move_file = fields.Boolean(string='Move file') + move_path = fields.Char(string='Move path') def _get_method(self): res = [] @@ -69,6 +72,9 @@ class Task(models.Model): 'path': self.filepath, 'attachment_ids': self.attachment_ids, 'task': self, + 'move_path': self.move_path, + 'delete_file': self.delete_file, + 'move_file': self.move_file, } conn = method_class(self.env, config) conn.run() diff --git a/external_file_location/task_view.xml b/external_file_location/task_view.xml index 08e3bdfe..9a53b833 100644 --- a/external_file_location/task_view.xml +++ b/external_file_location/task_view.xml @@ -16,6 +16,9 @@ + + +