[REM] web: remove unused controller /apps/<app>
This controller never really worked in the last 3 versions. It was fixed in 11.3 withe9350993cabut broken with refactoring in 12.0 at a higher level with19eacf7d23. It was even worse in 13.0 as it was leading to a traceback: `view_type` field got removed with3cd7ed07a2but this controller was still reading that field. closes odoo/odoo#38355 X-original-commit: a5c4e262449fef03d05d5250e4523832db5fbf00 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -1839,28 +1839,6 @@ class ExcelExport(ExportFormat, http.Controller):
|
||||
|
||||
return xlsx_writer.value
|
||||
|
||||
class Apps(http.Controller):
|
||||
@http.route('/apps/<app>', auth='user')
|
||||
def get_app_url(self, req, app):
|
||||
try:
|
||||
record = request.env.ref('base.open_module_tree')
|
||||
action = record.read(['name', 'type', 'res_model', 'view_mode', 'view_type', 'context', 'views', 'domain'])[0]
|
||||
action['target'] = 'current'
|
||||
except ValueError:
|
||||
action = False
|
||||
try:
|
||||
app_id = request.env.ref('base.module_%s' % app).id
|
||||
except ValueError:
|
||||
app_id = False
|
||||
|
||||
if action and app_id:
|
||||
action['res_id'] = app_id
|
||||
action['view_mode'] = 'form'
|
||||
action['views'] = [(False, u'form')]
|
||||
|
||||
sakey = Session().save_session_action(action)
|
||||
return werkzeug.utils.redirect('/web#sa={0}'.format(sakey))
|
||||
|
||||
|
||||
class ReportController(http.Controller):
|
||||
|
||||
|
||||
@@ -58,11 +58,8 @@ ActionManager.include({
|
||||
* @param {string} [state.view_type]
|
||||
*/
|
||||
loadState: function (state) {
|
||||
var callersArguments = arguments;
|
||||
var _super = this._super.bind(this);
|
||||
var self = this;
|
||||
var action;
|
||||
var def;
|
||||
var options = {
|
||||
clear_breadcrumbs: true,
|
||||
pushState: false,
|
||||
@@ -117,20 +114,12 @@ ActionManager.include({
|
||||
action = lastAction;
|
||||
options.viewType = state.view_type;
|
||||
}
|
||||
} else if (state.sa) {
|
||||
def = this._rpc({
|
||||
route: '/web/session/get_session_action',
|
||||
params: {key: state.sa},
|
||||
}).then(function (sessionAction) {
|
||||
action = sessionAction;
|
||||
});
|
||||
}
|
||||
return Promise.all([def]).then(function () {
|
||||
if (action) {
|
||||
return self.doAction(action, options);
|
||||
}
|
||||
return _super.apply(self, callersArguments);
|
||||
});
|
||||
if (action) {
|
||||
return this.doAction(action, options);
|
||||
}
|
||||
return _super.apply(this, arguments);
|
||||
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@@ -1275,30 +1275,6 @@ QUnit.module('ActionManager', {
|
||||
actionManager.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('state.sa should load action from session', async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var actionManager = await createActionManager({
|
||||
actions: this.actions,
|
||||
archs: this.archs,
|
||||
data: this.data,
|
||||
mockRPC: function (route, args) {
|
||||
if (route === '/web/session/get_session_action') {
|
||||
return Promise.resolve(1);
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
await actionManager.loadState({
|
||||
sa: 1,
|
||||
});
|
||||
|
||||
assert.strictEqual(actionManager.$('.o_kanban_view').length, 1,
|
||||
"should have rendered a kanban view");
|
||||
|
||||
actionManager.destroy();
|
||||
});
|
||||
|
||||
QUnit.module('Concurrency management');
|
||||
|
||||
QUnit.test('drop previous actions if possible', async function (assert) {
|
||||
|
||||
Reference in New Issue
Block a user