[IMP] web,point_of_sale: debug mode

Keep debug mode status when going on another location url (backend,
frontend, pos, ...).
This commit is contained in:
qsm-odoo
2016-01-15 15:24:09 +01:00
parent b9768c7022
commit 5a76586ede
2 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ odoo.define('point_of_sale.gui', function (require) {
var core = require('web.core');
var Model = require('web.DataModel');
var formats = require('web.formats');
var session = require('web.session');
var _t = core._t;
@@ -336,7 +337,7 @@ var Gui = core.Class.extend({
this.pos.push_order().then(function(){
return new Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id'])
.pipe(function(res) {
window.location = '/web#action=' + res[0]['res_id'];
window.location = '/web' + ((session.debug)? '?debug' : '') + '#action=' + res[0]['res_id'];
},function(err,event) {
event.preventDefault();
self.show_popup('error',{
+7 -2
View File
@@ -788,10 +788,15 @@ var ActionManager = Widget.extend({
});
},
ir_actions_act_url: function (action) {
var url = action.url;
if (session.debug && url && url.length && url[0] === '/') {
url = $.param.querystring(url, 'debug');
}
if (action.target === 'self') {
framework.redirect(action.url);
framework.redirect(url);
} else {
window.open(action.url, '_blank');
window.open(url, '_blank');
}
return $.when();
},