summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/account/static/src/js/account_reconciliation_widgets.js9
-rw-r--r--addons/document/static/src/js/document.js3
-rw-r--r--addons/google_spreadsheet/static/src/js/search.js4
-rw-r--r--addons/mail/static/src/js/client_action.js17
-rw-r--r--addons/sales_team/static/src/js/sales_team_dashboard.js1
5 files changed, 21 insertions, 13 deletions
diff --git a/addons/account/static/src/js/account_reconciliation_widgets.js b/addons/account/static/src/js/account_reconciliation_widgets.js
index e1855ca5513..e8749388c1e 100644
--- a/addons/account/static/src/js/account_reconciliation_widgets.js
+++ b/addons/account/static/src/js/account_reconciliation_widgets.js
@@ -493,21 +493,20 @@ var abstractReconciliationLine = Widget.extend({
// field_manager
var dataset = new data.DataSet(this, "account.account", self.context);
dataset.ids = [];
- dataset.arch = {
+ var fields_view = {};
+ fields_view.arch = {
attrs: { string: "Stéphanie de Monaco", version: "7.0", class: "oe_form_container o_form_container" },
children: [],
tag: "form"
};
-
self.field_manager = new FormView (
- this, dataset, false, {
+ this, dataset, fields_view, {
initial_mode: 'edit',
disable_autofocus: false,
$buttons: $(),
$pager: $()
});
-
- self.field_manager.load_form(dataset);
+ self.field_manager.appendTo(document.createDocumentFragment()); // starts the FormView
// fields default properties
var Default_field = function() {
diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js
index 9448a93adb9..05885839469 100644
--- a/addons/document/static/src/js/document.js
+++ b/addons/document/static/src/js/document.js
@@ -9,7 +9,8 @@ var _t = core._t;
Sidebar.include({
init : function(){
this._super.apply(this, arguments);
- if (this.getParent().view_type == "form"){
+ var view = this.getParent();
+ if (view.fields_view && view.fields_view.type === "form") {
this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), });
this.items.files = [];
}
diff --git a/addons/google_spreadsheet/static/src/js/search.js b/addons/google_spreadsheet/static/src/js/search.js
index abed0a383a3..b1a71c0a034 100644
--- a/addons/google_spreadsheet/static/src/js/search.js
+++ b/addons/google_spreadsheet/static/src/js/search.js
@@ -27,8 +27,8 @@ FormView.include({
});
FavoriteMenu.include({
- prepare_dropdown_menu: function (filters) {
- this._super(filters);
+ start: function () {
+ this._super();
var am = this.findAncestor(function(a) {
return a instanceof ActionManager;
});
diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js
index 64bd86568ad..73e89a285b3 100644
--- a/addons/mail/static/src/js/client_action.js
+++ b/addons/mail/static/src/js/client_action.js
@@ -160,6 +160,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
init: function(parent, action, options) {
this._super.apply(this, arguments);
this.action_manager = parent;
+ this.dataset = new data.DataSetSearch(this, 'mail.message');
this.domain = [];
this.action = action;
this.options = options || {};
@@ -170,7 +171,17 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
},
willStart: function () {
- return chat_manager.is_ready;
+ var self = this;
+ var view_id = this.action && this.action.search_view_id && this.action.search_view_id[0];
+ var def = this.dataset._model.fields_view_get({
+ view_id: view_id,
+ view_type: 'search',
+ context: this.dataset.get_context(),
+ toolbar: false,
+ }).then(function (fields_view) {
+ self.fields_view = fields_view;
+ });
+ return $.when(this._super(), chat_manager.is_ready, def);
},
start: function() {
@@ -182,8 +193,6 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
action: this.action,
disable_groupby: true,
};
- var dataset = new data.DataSetSearch(this, 'mail.message');
- var view_id = (this.action && this.action.search_view_id && this.action.search_view_id[0]) || false;
var default_channel_id = this.options.active_id ||
this.action.context.active_id ||
this.action.params.default_active_id ||
@@ -191,7 +200,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
var default_channel = chat_manager.get_channel(default_channel_id) ||
chat_manager.get_channel('channel_inbox');
- this.searchview = new SearchView(this, dataset, view_id, {}, options);
+ this.searchview = new SearchView(this, this.dataset, this.fields_view, options);
this.searchview.on('search_data', this, this.on_search);
this.basic_composer = new composer.BasicComposer(this, {mention_partners_restricted: true});
diff --git a/addons/sales_team/static/src/js/sales_team_dashboard.js b/addons/sales_team/static/src/js/sales_team_dashboard.js
index aadb7105bff..4d3a08df7c8 100644
--- a/addons/sales_team/static/src/js/sales_team_dashboard.js
+++ b/addons/sales_team/static/src/js/sales_team_dashboard.js
@@ -15,7 +15,6 @@ var _lt = core._lt;
var SalesTeamDashboardView = KanbanView.extend({
display_name: _lt('Dashboard'),
icon: 'fa-dashboard',
- view_type: "sales_team_dashboard",
searchview_hidden: true,
events: {
'click .o_dashboard_action': 'on_dashboard_action_clicked',