diff --git a/external_file_location/task.py b/external_file_location/task.py index f40bdb34..c7803056 100644 --- a/external_file_location/task.py +++ b/external_file_location/task.py @@ -31,6 +31,7 @@ class Task(models.Model): name = fields.Char() method = fields.Selection(selection='_get_method') + method_type = fields.Char() filename = fields.Char() filepath = fields.Char() location_id = fields.Many2one('external.file.location', string='Location') @@ -49,6 +50,13 @@ class Task(models.Model): res.append(cls_info) return res + @api.onchange('method') + def onchage_method(self): + if 'import' in self.method: + self.method_type = 'import' + elif 'export' in self.method: + self.method_type = 'export' + @api.model def _run(self, domain=None): if not domain: diff --git a/external_file_location/task_view.xml b/external_file_location/task_view.xml index 9a53b833..2281ef8b 100644 --- a/external_file_location/task_view.xml +++ b/external_file_location/task_view.xml @@ -7,6 +7,7 @@
+
- - - - - - - + + + + + + + + +