forked from nhomar/actions_server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsee_translations.py
More file actions
31 lines (29 loc) · 811 Bytes
/
see_translations.py
File metadata and controls
31 lines (29 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
domain = [('type', '=', 'view')]
context.update({
'default_module': '__custo__',
'default_type': 'view',
})
if object.type == "qweb":
parent = object.inherit_id
current = object
while parent and current.mode != 'base':
current = parent
parent = parent.inherit_id
domain += [('res_id', '=', current.id)]
context.update({
'default_name': 'website',
'default_res_id': current.id,
})
else:
domain += [('name', '=', object.model)]
context.update({
'search_default_group_by_src': 1,
'default_name': object.model,
})
action_dict = pool['ir.actions.act_window'].for_xml_id(
cr, uid, 'base', 'action_translation', context=context)
action_dict.update({
'domain': domain,
'context': context,
})
action = action_dict