diff --git a/tryton/action/main.py b/tryton/action/main.py index 574bec865d..05bfc89a2e 100644 --- a/tryton/action/main.py +++ b/tryton/action/main.py @@ -88,7 +88,7 @@ class Action(object): action_type = res['type'] try: res = rpc.execute('model', action_type, 'search_read', - [('action', '=', act_id)], 0, 1, None, ctx, None) + [('action', '=', act_id)], 0, 1, None, None, ctx) except Exception, exception: common.process_exception(exception, window) return diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 092ffd5911..62391c555d 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -1078,12 +1078,14 @@ class Main(object): if not rpc._USER: return if not exception: - res = rpc.execute('model', 'res.request', 'request_get') + res = rpc.execute('model', 'res.request', 'request_get', + rpc.CONTEXT) if not res: return ([], []) ids, ids2 = res else: - ids, ids2 = rpc.execute('model', 'res.request', 'request_get') + ids, ids2 = rpc.execute('model', 'res.request', 'request_get', + rpc.CONTEXT) label = _('Requests (%s/%s)') % (len(ids), len(ids2)) self.buttons['but_request'].set_label(label) self.tooltips.set_tip(self.buttons['but_request'], label) diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index 317c354a96..9bd3ac8606 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -459,7 +459,7 @@ class Record(SignalEvent): if self.attachment_count < 0 or reload: args = ('model', 'ir.attachment', 'search_count', [ ('resource', '=', '%s,%s' % (self.model_name, self.id)), - ]) + ], rpc.CONTEXT) try: self.attachment_count = rpc.execute(*args) except Exception: diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index 2f72db2e1c..44b737b6d0 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -292,8 +292,9 @@ class Screen(SignalEvent): ctx.update(rpc.CONTEXT) ctx.update(self.context) args = ('model', self.model_name, 'fields_view_get', - view_id, view_type, ctx, - self.parent and False or CONFIG['form.toolbar']) + view_id, view_type, + self.parent and False or CONFIG['form.toolbar'], + ctx) try: view = rpc.execute(*args) except Exception, exception: diff --git a/tryton/gui/window/view_form/view/form_gtk/many2one.py b/tryton/gui/window/view_form/view/form_gtk/many2one.py index ffae49f613..61865cf947 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -74,8 +74,8 @@ class Many2One(WidgetInterface): if attrs.get('completion', False): try: result = rpc.execute('model', self.attrs['relation'], - 'search_read', [], 0, None, None, rpc.CONTEXT, - ['rec_name']) + 'search_read', [], 0, None, None, ['rec_name'], + rpc.CONTEXT) names = [(x['id'], x['rec_name']) for x in result] except Exception, exception: common.process_exception(exception, self.window) diff --git a/tryton/gui/window/view_form/view/form_gtk/parser.py b/tryton/gui/window/view_form/view/form_gtk/parser.py index c99fc2e18d..12318c8e85 100644 --- a/tryton/gui/window/view_form/view/form_gtk/parser.py +++ b/tryton/gui/window/view_form/view/form_gtk/parser.py @@ -646,7 +646,8 @@ class ParserForm(ParserInterface): obj_id = self.screen.current_record.save(force_reload=False) try: lang_ids = rpc.execute('model', 'ir.lang', - 'search', [('translatable', '=', '1')]) + 'search', [('translatable', '=', '1')], + rpc.CONTEXT) except Exception, exception: common.process_exception(exception, self.window) return False @@ -657,9 +658,11 @@ class ParserForm(ParserInterface): return False try: lang_ids += rpc.execute('model', 'ir.lang', - 'search', [('code', '=', 'en_US')]) + 'search', [('code', '=', 'en_US')], + rpc.CONTEXT) langs = rpc.execute('model', 'ir.lang', - 'read', lang_ids, ['code', 'name']) + 'read', lang_ids, ['code', 'name'], + rpc.CONTEXT) except Exception, exception: common.process_exception(exception, self.window) return False diff --git a/tryton/gui/window/view_form/view/form_gtk/selection.py b/tryton/gui/window/view_form/view/form_gtk/selection.py index a0e7681034..e5850f6289 100644 --- a/tryton/gui/window/view_form/view/form_gtk/selection.py +++ b/tryton/gui/window/view_form/view/form_gtk/selection.py @@ -41,7 +41,7 @@ class Selection(WidgetInterface): if 'relation' in attrs: try: result = rpc.execute('model', attrs['relation'], 'search_read', - domain, 0, None, None, rpc.CONTEXT, ['rec_name']) + domain, 0, None, None, ['rec_name'], rpc.CONTEXT) selection = [(x['id'], x['rec_name']) for x in result] except Exception, exception: common.process_exception(exception, self.window) diff --git a/tryton/gui/window/view_form/view/list_gtk/parser.py b/tryton/gui/window/view_form/view/list_gtk/parser.py index 083dcddb82..a5a07b1180 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -678,8 +678,8 @@ class Selection(Char): self.selection = selection[:] if 'relation' in self.attrs: args = ('model', self.attrs['relation'], 'search_read', - self.attrs.get('domain', []), 0, None, None, rpc.CONTEXT, - ['rec_name']) + self.attrs.get('domain', []), 0, None, None, ['rec_name'], + rpc.CONTEXT) try: result = rpc.execute(*args) except Exception, exception: diff --git a/tryton/gui/window/view_form/widget_search/reference.py b/tryton/gui/window/view_form/widget_search/reference.py index 228278348e..66a13f04a4 100644 --- a/tryton/gui/window/view_form/widget_search/reference.py +++ b/tryton/gui/window/view_form/widget_search/reference.py @@ -42,7 +42,7 @@ class Reference(Interface): result = rpc.execute('model', self.attrs['relation'], 'search_read', self.attrs.get('domain', []), - 0, None, None, rpc.CONTEXT, ['rec_name']) + 0, None, None, ['rec_name'], rpc.CONTEXT) selection = [(x['id'], x['rec_name']) for x in result] except Exception, exception: common.process_exception(exception, parent) diff --git a/tryton/gui/window/view_form/widget_search/selection.py b/tryton/gui/window/view_form/widget_search/selection.py index 4a223e56ab..4df7dd54c3 100644 --- a/tryton/gui/window/view_form/widget_search/selection.py +++ b/tryton/gui/window/view_form/widget_search/selection.py @@ -41,7 +41,7 @@ class Selection(Interface): result = rpc.execute('model', self.attrs['relation'], 'search_read', self.attrs.get('domain', []), - 0, None, None, rpc.CONTEXT, ['rec_name']) + 0, None, None, ['rec_name'], rpc.CONTEXT) selection = [(x['id'], x['rec_name']) for x in result] except Exception, exception: common.process_exception(exception, parent) diff --git a/tryton/gui/window/view_tree/view_tree.py b/tryton/gui/window/view_tree/view_tree.py index f8aafc126c..4fc5920777 100644 --- a/tryton/gui/window/view_tree/view_tree.py +++ b/tryton/gui/window/view_tree/view_tree.py @@ -103,7 +103,7 @@ class ViewTreeModel(gtk.GenericTreeModel, gtk.TreeSortable): 'search_read', self.fields_type[field].get('domain', []), 0, None, None, - rpc.CONTEXT, ['rec_name']) + ['rec_name'], rpc.CONTEXT) selection = [(x['id'], x['rec_name']) for x in result] except Exception: selection = [] diff --git a/tryton/wizard/main.py b/tryton/wizard/main.py index eb55eb5d9d..57e0997dbe 100644 --- a/tryton/wizard/main.py +++ b/tryton/wizard/main.py @@ -167,7 +167,7 @@ class Wizard(object): from tryton.action import Action if not 'form' in datas: datas['form'] = {} - args = ('wizard', action, 'create') + args = ('wizard', action, 'create', rpc.CONTEXT) try: wiz_id = rpc.execute(*args) except Exception, exception: @@ -246,7 +246,7 @@ class Wizard(object): dia.destroy() dia = None try: - rpc.execute('wizard', action, 'delete', wiz_id) + rpc.execute('wizard', action, 'delete', wiz_id, rpc.CONTEXT) #XXX to remove when company displayed in status bar rpc.context_reload() except Exception: