From 3b00af2cde922dfbfb4f123f5af0a0b65dd72d9b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 29 Jul 2011 16:42:27 +0200 Subject: [PATCH] [IMP] handling of config items: display all manual, cross those marked as done bzr revid: xmo@openerp.com-20110729144227-l5nz6jqdxfy7jsic --- .../static/src/css/dashboard.css | 2 ++ .../base_dashboard/static/src/js/dashboard.js | 19 +++++++++---------- .../static/src/xml/base_dashboard.xml | 7 ++++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/addons/base_dashboard/static/src/css/dashboard.css b/addons/base_dashboard/static/src/css/dashboard.css index c534bf732a4..8ec00ec6d89 100644 --- a/addons/base_dashboard/static/src/css/dashboard.css +++ b/addons/base_dashboard/static/src/css/dashboard.css @@ -171,7 +171,9 @@ } .openerp .oe-dashboard-config-overview li.oe-done { + cursor: default; color: #999999; + text-decoration: line-through; } .openerp .oe-dashboard-layout_2-1 .index_0 .oe-dashboard-config-overview ul, diff --git a/addons/base_dashboard/static/src/js/dashboard.js b/addons/base_dashboard/static/src/js/dashboard.js index b3ff4d051ca..b5e59c17000 100644 --- a/addons/base_dashboard/static/src/js/dashboard.js +++ b/addons/base_dashboard/static/src/js/dashboard.js @@ -287,14 +287,12 @@ openerp.base_dashboard.ConfigOverview = openerp.base.View.extend({ this._super(parent, element_id); this.dataset = new openerp.base.DataSetSearch( this, 'ir.actions.todo'); - this.dataset.domain = ['|', '&', ['type', '=', 'recurring'], - ['state', '!=', 'hidden'], - '&', ['type', '!=', 'special'], - ['state', '=', 'open']]; + this.dataset.domain = [['type', '=', 'manual']]; }, start: function () { $.when(this.dataset.read_slice(['state', 'action_id', 'category_id']), - this.dataset.call('progress')).then(this.on_records_loaded); + this.dataset.call('progress')) + .then(this.on_records_loaded); }, on_records_loaded: function (read_response, progress_response) { var records = read_response[0].records, @@ -321,15 +319,16 @@ openerp.base_dashboard.ConfigOverview = openerp.base.View.extend({ var self = this; this.$element.find('div.oe-dashboard-config-overview ul') - .delegate('span.ui-icon', 'click', function (e) { - // cancel todo + .delegate('input', 'click', function (e) { + // switch todo status e.stopImmediatePropagation(); - var todo_id = $(this).parent().data('id'); - self.dataset.write(todo_id, {state: 'hidden'}, function () { + var new_state = this.checked ? 'done' : 'open', + todo_id = parseInt($(this).val(), 10); + self.dataset.write(todo_id, {state: new_state}, function () { self.start(); }); }) - .delegate('li', 'click', function () { + .delegate('li:not(.oe-done)', 'click', function () { self.execute_action({ type: 'object', name: 'action_launch' diff --git a/addons/base_dashboard/static/src/xml/base_dashboard.xml b/addons/base_dashboard/static/src/xml/base_dashboard.xml index c8aa567f5fb..ad432348c38 100644 --- a/addons/base_dashboard/static/src/xml/base_dashboard.xml +++ b/addons/base_dashboard/static/src/xml/base_dashboard.xml @@ -78,10 +78,11 @@
  • + t-att-title="!todo.done ? 'Execute task \'' + todo.name + '\'' : undefined"> + -