Skip to content
Browse files

[FIX] project: fix can't edit attachment with studio


    - Install Projects & Studio
    - Go into projects app
    - Edit a project (... => Edit)
    - Click on x attachments stat button

    You can't edit with studio


    Writing the action manually instead of using the base one
    result with an empty xml_id (and a lot of missing data).


    Use base.action_attachment like others modules do (e.g. helpdesk).


closes #43144

X-original-commit: 62629db
Signed-off-by: Nicolas Martinelli (nim) <>
  • Loading branch information
jvm-odoo committed Jan 10, 2020
1 parent ff4e772 commit 856b09d7055ebbfebbe3b5dc3093e429c8c930ff
Showing with 12 additions and 19 deletions.
  1. +12 −19 addons/project/models/
@@ -96,26 +96,19 @@ def _compute_task_count(self):
project.task_count = result.get(, 0)

def attachment_tree_view(self):
domain = [
attachment_action = self.env.ref('base.action_attachment')
action =[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': _('''<p class="o_view_nocontent_smiling_face">
Documents are attached to the tasks of your project.</p><p>
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,
('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,
return action

def activate_sample_project(self):

0 comments on commit 856b09d

Please sign in to comment.
You can’t perform that action at this time.