[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:
@@ -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',{
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user