From fadd46c5cbe8de3a79644b5ddcd1ee0acb966807 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 21 Oct 2013 17:51:20 +0200 Subject: [PATCH 1/4] hr_holidays: force refuse.@flow_stop to False to correctly update existing databases bzr revid: odo@openerp.com-20131021155120-vn63of44ya0od9e2 --- addons/hr_holidays/hr_holidays_workflow.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_holidays/hr_holidays_workflow.xml b/addons/hr_holidays/hr_holidays_workflow.xml index b563dbf68d4..c539ff6de41 100644 --- a/addons/hr_holidays/hr_holidays_workflow.xml +++ b/addons/hr_holidays/hr_holidays_workflow.xml @@ -55,6 +55,7 @@ refuse + function holidays_refuse() From d97bd2bce2bd9b5c338541ac43268eacb04fbd9e Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 22 Oct 2013 12:41:45 +0200 Subject: [PATCH 2/4] [FIX] web: avoid useless redirection when in mono db mode bzr revid: chs@openerp.com-20131022104145-janmthq1r6sibm2e --- addons/web/controllers/main.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 2d585fe2466..9584c53ca5b 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -529,12 +529,14 @@ class Home(http.Controller): def index(self, s_action=None, db=None, debug=False, **kw): debug = debug != False - lst = http.db_list(True) + try: + lst = http.db_list() + except openerp.exceptions.AccessDenied: + lst = [] + if db not in lst: db = None guessed_db = http.db_monodb(request.httprequest) - if guessed_db is None and len(lst) > 0: - guessed_db = lst[0] def redirect(db): query = dict(urlparse.parse_qsl(request.httprequest.query_string, keep_blank_values=True)) @@ -542,8 +544,11 @@ class Home(http.Controller): redirect = request.httprequest.path + '?' + urllib.urlencode(query) return redirect_with_hash(redirect) - if db is None and guessed_db is not None: - return redirect(guessed_db) + if guessed_db is None and db is None and lst: + return redirect(lst[0]) + + if guessed_db is None and lst: + guessed_db = lst[0] if db is not None and db != guessed_db: request.session.logout() From 91fdcc63a73f882d58316a55631012a17e10f6ca Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 22 Oct 2013 15:10:49 +0200 Subject: [PATCH 3/4] [FIX] board: correct /board/add_to_dashboard to use new @route decorator and request object bzr revid: chs@openerp.com-20131022131049-lb6mva47y0i3kpvq --- addons/board/controllers.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/addons/board/controllers.py b/addons/board/controllers.py index 3bdebe1ef26..93634627352 100644 --- a/addons/board/controllers.py +++ b/addons/board/controllers.py @@ -1,24 +1,22 @@ # -*- coding: utf-8 -*- from xml.etree import ElementTree -import openerp from openerp.addons.web.controllers.main import load_actions_from_ir_values +from openerp.addons.web.http import Controller, route, request -class Board(openerp.addons.web.http.Controller): - _cp_path = '/board' - - @openerp.addons.web.http.jsonrequest - def add_to_dashboard(self, req, menu_id, action_id, context_to_save, domain, view_mode, name=''): +class Board(Controller): + @route('/board/add_to_dashboard', type='json', auth='user') + def add_to_dashboard(self, menu_id, action_id, context_to_save, domain, view_mode, name=''): # FIXME move this method to board.board model - dashboard_action = load_actions_from_ir_values( - req, 'action', 'tree_but_open', [('ir.ui.menu', menu_id)], False) + dashboard_action = load_actions_from_ir_values('action', 'tree_but_open', + [('ir.ui.menu', menu_id)], False) if dashboard_action: action = dashboard_action[0][2] if action['res_model'] == 'board.board' and action['views'][0][1] == 'form': # Maybe should check the content instead of model board.board ? view_id = action['views'][0][0] - board = req.session.model(action['res_model']).fields_view_get(view_id, 'form') + board = request.session.model(action['res_model']).fields_view_get(view_id, 'form') if board and 'arch' in board: xml = ElementTree.fromstring(board['arch']) column = xml.find('./board/column') @@ -32,10 +30,10 @@ class Board(openerp.addons.web.http.Controller): }) column.insert(0, new_action) arch = ElementTree.tostring(xml, 'utf-8') - return req.session.model('ir.ui.view.custom').create({ - 'user_id': req.session._uid, + return request.session.model('ir.ui.view.custom').create({ + 'user_id': request.session.uid, 'ref_id': view_id, 'arch': arch - }, req.context) + }, request.context) return False From c58f13c8e91f193201dba08b63c19c16617870d6 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 22 Oct 2013 19:10:10 +0200 Subject: [PATCH 4/4] [FIX] im: do not search users before start polling. This avoid a race condition for im.user creation bzr revid: chs@openerp.com-20131022171010-ilfvqced6q8qta3h --- addons/im/static/src/js/im.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/im/static/src/js/im.js b/addons/im/static/src/js/im.js index 6fbf452f974..f4b74adebf6 100644 --- a/addons/im/static/src/js/im.js +++ b/addons/im/static/src/js/im.js @@ -62,16 +62,12 @@ this.user_search_dm = new instance.web.DropMisordered(); }, start: function() { + var self = this; this.$el.css("right", -this.$el.outerWidth()); $(window).scroll(_.bind(this.calc_box, this)); $(window).resize(_.bind(this.calc_box, this)); this.calc_box(); - this.on("change:current_search", this, this.search_changed); - this.search_changed(); - - var self = this; - return this.c_manager.start_polling().then(function() { self.c_manager.on("new_conversation", self, function(conv) { conv.$el.droppable({ @@ -80,6 +76,7 @@ } }); }); + self.search_changed(); }); }, calc_box: function() { @@ -174,4 +171,4 @@ openerp.webclient.to_kitten(); }; -})(); \ No newline at end of file +})();