Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3611 มุมมอง

Hello,

I have one problem, when we are in Project (project.project) view there have documents ,tasks, as a Button. and it also have the count. When we are click on Document its re direct to the view of document . and shows the no of document that related to the particular project .When i check the base code of project, i found they are created on python function to redirecting the view they given the name as attachment_tree_view, and they create another function for counting the number of document. Now my problem is that i need similar button as Inbox , and when i click on that it should gone to the (settings ->mail ->messages of that project), Is it possible to do?? i try to do that but i got error when i am trying to solve that, 

My code

def inbox_tree_view(self, cr, uid, ids, context):

 message_ids = self.pool.get('mail.message').search(cr, uid, [('parent_id', 'in', ids)])

domain = [
'|',
'&', ('res_model', '=', 'project.project'), ('res_id', 'in',[1]),
'&', ('res_model', '=', 'mail.message'), ('res_id', 'in', [51])]
res_id = ids and ids[0] or False
print"ppppppppppppppppppp",self._name, res_id
return {
'name': _('Message'),
'domain': domain,
'res_model': 'mail.message',
'type': 'ir.actions.act_window',
'view_id': False,
'view_mode': 'tree,form',
'view_type': 'form',
'limit': 80,
'context': "{'default_res_model': '%s','default_res_id': %d}" % (self._name, res_id)
}



Thanks,

Logicious

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 21
4167
0
ต.ค. 18
3077
How to add a description to a project? แก้ไขแล้ว
1
มิ.ย. 16
4526
1
พ.ย. 24
1976
Task stages not appear in project แก้ไขแล้ว
1
ธ.ค. 22
2352