Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sty 21
4101
0
paź 18
3039
1
cze 16
4459
1
lis 24
1842
1
gru 22
2270