Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(83)

Side by Side Diff: tryton/action/main.py

Issue 1746052: Set context as last param of RPC call for new protocol syntax (Closed)
Patch Set: Add missing context in ir.lang calls Created 14 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tryton/gui/main.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #This file is part of Tryton. The COPYRIGHT file at the top level of 1 #This file is part of Tryton. The COPYRIGHT file at the top level of
2 #this repository contains the full copyright notices and license terms. 2 #this repository contains the full copyright notices and license terms.
3 import time 3 import time
4 import datetime 4 import datetime
5 import tryton.rpc as rpc 5 import tryton.rpc as rpc
6 from tryton.wizard import Wizard 6 from tryton.wizard import Wizard
7 from tryton.common import message, error, selection, file_open, mailto 7 from tryton.common import message, error, selection, file_open, mailto
8 from tryton.gui.window import Window 8 from tryton.gui.window import Window
9 from tryton.pyson import PYSONDecoder 9 from tryton.pyson import PYSONDecoder
10 import gettext 10 import gettext
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 res = rpc.execute('model', 'ir.action', 'read', act_id, 81 res = rpc.execute('model', 'ir.action', 'read', act_id,
82 ['type'], ctx) 82 ['type'], ctx)
83 except Exception, exception: 83 except Exception, exception:
84 common.process_exception(exception, window) 84 common.process_exception(exception, window)
85 return 85 return
86 if not res: 86 if not res:
87 raise Exception, 'ActionNotFound' 87 raise Exception, 'ActionNotFound'
88 action_type = res['type'] 88 action_type = res['type']
89 try: 89 try:
90 res = rpc.execute('model', action_type, 'search_read', 90 res = rpc.execute('model', action_type, 'search_read',
91 [('action', '=', act_id)], 0, 1, None, ctx, None) 91 [('action', '=', act_id)], 0, 1, None, None, ctx)
92 except Exception, exception: 92 except Exception, exception:
93 common.process_exception(exception, window) 93 common.process_exception(exception, window)
94 return 94 return
95 Action._exec_action(res, window, datas) 95 Action._exec_action(res, window, datas)
96 96
97 @staticmethod 97 @staticmethod
98 def _exec_action(action, window, datas=None, context=None): 98 def _exec_action(action, window, datas=None, context=None):
99 if context is None: 99 if context is None:
100 context = {} 100 context = {}
101 if datas is None: 101 if datas is None:
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 res = selection(_('Select your action'), keyact, window, 199 res = selection(_('Select your action'), keyact, window,
200 alwaysask=alwaysask) 200 alwaysask=alwaysask)
201 if res: 201 if res:
202 (name, action) = res 202 (name, action) = res
203 Action._exec_action(action, window, data, context=context) 203 Action._exec_action(action, window, data, context=context)
204 return (name, action) 204 return (name, action)
205 elif not len(keyact) and warning: 205 elif not len(keyact) and warning:
206 message(_('No action defined!'), window) 206 message(_('No action defined!'), window)
207 return False 207 return False
OLDNEW
« no previous file with comments | « no previous file | tryton/gui/main.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b