summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets/debug_manager.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-03-05 10:05:56 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit905e01921f3c3ef43ace6fc537d1d8c0d280002c (patch)
tree265c43ab21c5401a5d9f0f3d64d86f1ac417451c /addons/web/static/src/js/widgets/debug_manager.js
parent54d4c73af4ad05c7640d28c1892247c9538b8017 (diff)
[REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views. We started basically from scratch. The goal was to unify all the various views under a common framework, to make them testable, to make then usable in different conditions (in studio, or in the frontend), and to make our lives easier. Some important points are: - we introduced new coding guidelines (camelCase, 80 chars width, ...) - we have a brand new testing framework (still QUnit based) - kanban view moved to the web addon - calendar view (formerly web_calender) moved to web as well - the tree view was removed - all new code should be documented We hope that this code is the start of a new era for the Odoo web client, we want to have a high quality codebase, well documented, well tested, well designed. Work done by the framework team: mostly aab, ged, chm, dmo, qsm
Diffstat (limited to 'addons/web/static/src/js/widgets/debug_manager.js')
-rw-r--r--addons/web/static/src/js/widgets/debug_manager.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/addons/web/static/src/js/widgets/debug_manager.js b/addons/web/static/src/js/widgets/debug_manager.js
index 2b207a9bb52..44845f7b9e6 100644
--- a/addons/web/static/src/js/widgets/debug_manager.js
+++ b/addons/web/static/src/js/widgets/debug_manager.js
@@ -2,7 +2,7 @@ odoo.define('web.DebugManager', function (require) {
"use strict";
var ActionManager = require('web.ActionManager');
-var common = require('web.form_common');
+var dialogs = require('web.view_dialogs');
var core = require('web.core');
var Dialog = require('web.Dialog');
var formats = require('web.formats');
@@ -159,7 +159,7 @@ var DebugManager = Widget.extend({
},
select_view: function () {
var self = this;
- new common.SelectCreateDialog(this, {
+ new dialogs.SelectCreateDialog(this, {
res_model: 'ir.ui.view',
title: _t('Select a view'),
disable_multiple_selection: true,
@@ -288,6 +288,9 @@ DebugManager.include({
update: function (tag, descriptor, widget) {
switch (tag) {
case 'action':
+ if (this._view_manager) {
+ this._view_manager.off('switch_mode', this);
+ }
if (!(widget instanceof ViewManager)) {
this._active_view = null;
this._view_manager = null;
@@ -314,11 +317,11 @@ DebugManager.include({
get_metadata: function() {
var ds = this._view_manager.dataset;
- if (!this._active_view.controller.get_selected_ids().length) {
+ if (!this._active_view.controller.getSelectedIds().length) {
console.warn(_t("No metadata available"));
return
}
- ds.call('get_metadata', [this._active_view.controller.get_selected_ids()]).done(function(result) {
+ ds.call('get_metadata', [this._active_view.controller.getSelectedIds()]).done(function(result) {
new Dialog(this, {
title: _.str.sprintf(_t("Metadata (%s)"), ds.model),
size: 'medium',
@@ -335,11 +338,11 @@ DebugManager.include({
fvg: function() {
var dialog = new Dialog(this, { title: _t("Fields View Get") }).open();
$('<pre>').text(utils.json_node_to_xml(
- this._active_view.controller.fields_view.arch, true)
+ this._active_view.controller.renderer.arch, true)
).appendTo(dialog.$el);
},
print_workflow: function() {
- var ids = this._active_view.controller.get_selected_ids();
+ var ids = this._active_view.controller.getSelectedIds();
framework.blockUI();
var action = {
context: { active_ids: ids },