diff --git a/addons/project/models/project.py b/addons/project/models/project.py index f00d0ea4bac..a449a16d1d4 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -96,26 +96,19 @@ class Project(models.Model): project.task_count = result.get(project.id, 0) def attachment_tree_view(self): - self.ensure_one() - domain = [ + attachment_action = self.env.ref('base.action_attachment') + action = attachment_action.read()[0] + action['domain'] = str([ '|', - '&', ('res_model', '=', 'project.project'), ('res_id', 'in', self.ids), - '&', ('res_model', '=', 'project.task'), ('res_id', 'in', self.task_ids.ids)] - return { - 'name': _('Attachments'), - 'domain': domain, - 'res_model': 'ir.attachment', - 'type': 'ir.actions.act_window', - 'view_id': False, - 'view_mode': 'kanban,tree,form', - 'help': _('''

- Documents are attached to the tasks of your project.

- Send messages or log internal notes with attachments to link - documents to your project. -

'''), - 'limit': 80, - 'context': "{'default_res_model': '%s','default_res_id': %d}" % (self._name, self.id) - } + '&', + ('res_model', '=', 'project.project'), + ('res_id', 'in', self.ids), + '&', + ('res_model', '=', 'project.task'), + ('res_id', 'in', self.task_ids.ids) + ]) + action['context'] = "{'default_res_model': '%s','default_res_id': %d}" % (self._name, self.id) + return action @api.model def activate_sample_project(self):