xxxxxxxxxx
1
@api.model
2
def get_dispatch_request_action(self):
3
'''
4
取得调车计划动作
5
:return:
6
'''
7
group_ids = self.env.user.groups_id
8
groups = self.env['ir.model.data']\
9
.search_read([('model', '=', 'res.groups'),
10
('res_id', 'in', group_ids.ids),
11
('module', '=', 'metro_park_base')], fields=['name'])
12
13
tree_id = self.env.ref(
14
'metro_park_dispatch.dispatch_request_list').id
15
form_id = self.env.ref(
16
'metro_park_dispatch.dispatch_request_form').id
17
18
return {
19
"type": "ir.actions.act_window",
20
"view_mode": "tree,form",
21
"res_model": "metro_park_dispatch.dispatch_request",
22
"name": "调车申请",
23
"views": [[tree_id, "tree"], [form_id, "form"]],
24
"context": {
25
"groups": groups
26
}
27
}
已复制