diff options
| author | Jigar Amin - OpenERP <jam@tinyerp.com> | 2012-06-07 16:06:47 +0530 |
|---|---|---|
| committer | Jigar Amin - OpenERP <jam@tinyerp.com> | 2012-06-07 16:06:47 +0530 |
| commit | fc9901c7a5dd4c5a1787a53ffae2c2795ac1db17 (patch) | |
| tree | 98cec2075ac4e7149e7eae8254746392c445fa22 /addons/web_dashboard/static/src/js | |
| parent | 7c8ed0a00c28bbee5e84ec584251d2218ac1209b (diff) | |
[IMP] Add action help if noaction on deshbaord
bzr revid: jam@tinyerp.com-20120607103647-8ylpddobydc6ed1d
Diffstat (limited to 'addons/web_dashboard/static/src/js')
| -rw-r--r-- | addons/web_dashboard/static/src/js/dashboard.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 761876929da..8b8d34c6368 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -231,6 +231,15 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ } }, renderElement: function() { + var self = this; + //to Check dash contains any action if not then show the action help + var array= []; + _.each(this.node.children, function(column, column_index) { + array.push(_.include(_.pluck(column.children,"tag"),"action")); + }); + if (! _.include(array,true)){ + return self.no_result(); + } // We should start with three columns available for (var i = this.node.children.length; i < 3; i++) { this.node.children.push({ @@ -242,6 +251,17 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ var rendered = QWeb.render(this.form_template, this); this.$element.html(rendered); }, + no_result: function () { + if (!this.view.options.action + || !this.view.options.action.help) { + return; + } + this.$element.prepend( + $('<div class="oe_view_nocontent">') + .append($('<img>', { src: '/web_dashboard/static/src/img/view_todo_arrow.png' })) + .append($('<div>').html(this.view.options.action.help)) + ); + }, do_reload: function() { var view_manager = this.view.getParent(), action_manager = view_manager.getParent(); |
