diff --git a/addons/account/account.py b/addons/account/account.py index a68c1de0939..33b52b643ed 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -719,7 +719,7 @@ class account_journal(osv.osv): 'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"), 'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'), 'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'), - 'entry_posted': fields.boolean('Skip \'Draft\' State for Manual Entries', help='Check this box if you don\'t want new journal entries to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation. \nNote that journal entries that are automatically created by the system are always skipping that state.'), + 'entry_posted': fields.boolean('Autopost Created Moves', help='Check this box to automatically post entries of this journal. Note that legally, some entries may be automatically posted when the source document is validated (Invoices), whatever the status of this field.'), 'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"), 'allow_date':fields.boolean('Check Date in Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'), diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index ccd87ba2616..a856bcdfdd4 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -322,7 +322,7 @@ - + diff --git a/addons/im/im.py b/addons/im/im.py index 4a867789cbc..505ca3627b6 100644 --- a/addons/im/im.py +++ b/addons/im/im.py @@ -101,17 +101,19 @@ class LongPollingController(http.Controller): raise Exception("Not usable in a server not running gevent") from openerp.addons.im.watcher import ImWatcher if db is not None: - request.session.authenticate(db=db, uid=uid, password=password) + openerp.service.security.check(db, uid, password) else: - request.session.authenticate(db=request.session._db, uid=request.session._uid, password=request.session._password) + uid = request.session.uid + db = request.session.db - with request.registry.cursor() as cr: - request.registry.get('im.user').im_connect(cr, request.uid, uuid=uuid, context=request.context) - my_id = request.registry.get('im.user').get_by_user_id(cr, request.uid, uuid or request.session._uid, request.context)["id"] + registry = openerp.modules.registry.RegistryManager.get(db) + with registry.cursor() as cr: + registry.get('im.user').im_connect(cr, uid, uuid=uuid, context=request.context) + my_id = registry.get('im.user').get_by_user_id(cr, uid, uuid or uid, request.context)["id"] num = 0 while True: - with request.registry.cursor() as cr: - res = request.registry.get('im.message').get_messages(cr, request.uid, last, users_watch, uuid=uuid, context=request.context) + with registry.cursor() as cr: + res = registry.get('im.message').get_messages(cr, uid, last, users_watch, uuid=uuid, context=request.context) if num >= 1 or len(res["res"]) > 0: return res last = res["last"] diff --git a/addons/im_livechat/im_livechat.py b/addons/im_livechat/im_livechat.py index adceebc7cba..b68a0079c3a 100644 --- a/addons/im_livechat/im_livechat.py +++ b/addons/im_livechat/im_livechat.py @@ -37,36 +37,45 @@ env.filters["json"] = json.dumps class LiveChatController(http.Controller): - @http.route('/im_livechat/loader') + def _auth(self, db): + reg = openerp.modules.registry.RegistryManager.get(db) + uid = openerp.netsvc.dispatch_rpc('common', 'authenticate', [db, "anonymous", "anonymous", None]) + return reg, uid + + @http.route('/im_livechat/loader', auth="none") def loader(self, **kwargs): p = json.loads(kwargs["p"]) db = p["db"] channel = p["channel"] user_name = p.get("user_name", None) - request.session.authenticate(db=db, login="anonymous", password="anonymous") - info = request.session.model('im_livechat.channel').get_info_for_chat_src(channel) - info["db"] = db - info["channel"] = channel - info["userName"] = user_name - return request.make_response(env.get_template("loader.js").render(info), - headers=[('Content-Type', "text/javascript")]) - @http.route('/im_livechat/web_page') + reg, uid = self._auth(db) + with reg.cursor() as cr: + info = reg.get('im_livechat.channel').get_info_for_chat_src(cr, uid, channel) + info["db"] = db + info["channel"] = channel + info["userName"] = user_name + return request.make_response(env.get_template("loader.js").render(info), + headers=[('Content-Type', "text/javascript")]) + + @http.route('/im_livechat/web_page', auth="none") def web_page(self, **kwargs): p = json.loads(kwargs["p"]) db = p["db"] channel = p["channel"] - request.session.authenticate(db=db, login="anonymous", password="anonymous") - script = request.session.model('im_livechat.channel').read(channel, ["script"])["script"] - info = request.session.model('im_livechat.channel').get_info_for_chat_src(channel) - info["script"] = script - return request.make_response(env.get_template("web_page.html").render(info), - headers=[('Content-Type', "text/html")]) + reg, uid = self._auth(db) + with reg.cursor() as cr: + script = reg.get('im_livechat.channel').read(cr, uid, channel, ["script"])["script"] + info = reg.get('im_livechat.channel').get_info_for_chat_src(cr, uid, channel) + info["script"] = script + return request.make_response(env.get_template("web_page.html").render(info), + headers=[('Content-Type', "text/html")]) - @http.route('/im_livechat/available', type='json') + @http.route('/im_livechat/available', type='json', auth="none") def available(self, db, channel): - request.session.authenticate(db=db, login="anonymous", password="anonymous") - return request.session.model('im_livechat.channel').get_available_user(channel) > 0 + reg, uid = self._auth(db) + with reg.cursor() as cr: + return reg.get('im_livechat.channel').get_available_user(cr, uid, channel) > 0 class im_livechat_channel(osv.osv): _name = 'im_livechat.channel' diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 21b0f5a9a87..5d54a6acc48 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -967,6 +967,24 @@ openerp.mail = function (session) { this.$('.oe_reply').on('click', this.on_message_reply); this.$('.oe_star').on('click', this.on_star); this.$('.oe_msg_vote').on('click', this.on_vote); + this.$('.oe_mail_action_model').on('click', this.on_record_clicked); + }, + + on_record_clicked: function (event) { + event.stopPropagation(); + var state = { + 'model': this.model, + 'id': this.res_id, + 'title': this.record_name + }; + session.webclient.action_manager.do_push_state(state); + this.do_action({ + res_model: state.model, + res_id: state.id, + type: 'ir.actions.act_window', + views: [[false, 'form']] + }); + return false; }, /* Call the on_compose_message on the thread of this message. */ diff --git a/addons/point_of_sale/controllers/main.py b/addons/point_of_sale/controllers/main.py index 5561375717c..9b8793bca21 100644 --- a/addons/point_of_sale/controllers/main.py +++ b/addons/point_of_sale/controllers/main.py @@ -9,7 +9,6 @@ from openerp.addons.web.http import request from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template class PointOfSaleController(http.Controller): - #_cp_path = '/pos' @http.route('/pos/app', type='http', auth='admin') def app(self): @@ -18,7 +17,8 @@ class PointOfSaleController(http.Controller): cookie = request.httprequest.cookies.get("instance0|session_id") session_id = cookie.replace("%22","") - template = html_template.replace('