From 8d38f72cfb743e38add91e22a5846f24b674c3ef Mon Sep 17 00:00:00 2001 From: Valentin Chemiere Date: Thu, 26 Feb 2015 18:14:09 +0100 Subject: [PATCH] Dedicated tree for attachments, some view tweaks and renaming task object --- external_file_location/attachment.py | 3 +- external_file_location/attachment_view.xml | 41 +++++++++++++++++++++- external_file_location/location.py | 1 + external_file_location/location_view.xml | 14 ++++++-- external_file_location/task.py | 2 +- external_file_location/task_view.xml | 8 ++--- external_file_location/tasks/ftp.py | 16 ++++++--- 7 files changed, 70 insertions(+), 15 deletions(-) diff --git a/external_file_location/attachment.py b/external_file_location/attachment.py index cb23810d..33e55086 100644 --- a/external_file_location/attachment.py +++ b/external_file_location/attachment.py @@ -27,8 +27,9 @@ class IrAttachment(models.Model): _inherit = 'ir.attachment' sync_date = fields.Datetime() - parse_state = fields.Selection([ + state = fields.Selection([ ('pending', 'Pending'), ('failed', 'Failed'), ('done', 'Done'), ], readonly=True, required=True, default='pending') + state_message = fields.Text() diff --git a/external_file_location/attachment_view.xml b/external_file_location/attachment_view.xml index 69cd719e..73f833e1 100644 --- a/external_file_location/attachment_view.xml +++ b/external_file_location/attachment_view.xml @@ -8,11 +8,50 @@ - + + + + ir.attachment + + + + + + + + + + + + + + + + + Attachments + ir.actions.act_window + ir.attachment + form + kanban,tree,form + + + + + + tree + + + + + + diff --git a/external_file_location/location.py b/external_file_location/location.py index 07555b68..8d26e462 100644 --- a/external_file_location/location.py +++ b/external_file_location/location.py @@ -34,6 +34,7 @@ class Location(models.Model): port = fields.Integer() login = fields.Char() password = fields.Char() + task_ids = fields.One2many('external.file.task', 'location_id') def _get_protocol(self): diff --git a/external_file_location/location_view.xml b/external_file_location/location_view.xml index c3fed2ce..7136a2f5 100644 --- a/external_file_location/location_view.xml +++ b/external_file_location/location_view.xml @@ -14,7 +14,17 @@ - + + + + + + + + +