diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-07-29 16:42:27 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-07-29 16:42:27 +0200 |
| commit | 3b00af2cde922dfbfb4f123f5af0a0b65dd72d9b (patch) | |
| tree | 9ab5efb4c03eae75948ba3cd4ca7f0d81bc73bce /addons/base_dashboard/static/src | |
| parent | 483689d7690d870579554a02b7cc3ae1c65123ec (diff) | |
[IMP] handling of config items: display all manual, cross those marked as done
bzr revid: xmo@openerp.com-20110729144227-l5nz6jqdxfy7jsic
Diffstat (limited to 'addons/base_dashboard/static/src')
| -rw-r--r-- | addons/base_dashboard/static/src/css/dashboard.css | 2 | ||||
| -rw-r--r-- | addons/base_dashboard/static/src/js/dashboard.js | 19 | ||||
| -rw-r--r-- | addons/base_dashboard/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 @@ <li t-foreach="category_value" t-as="todo" t-att-class="todo.done ? 'oe-done' : undefined" t-att-data-id="todo.id" - t-att-title="'Execute action \'' + todo.name + '\''"> + t-att-title="!todo.done ? 'Execute task \'' + todo.name + '\'' : undefined"> + <input type="checkbox" t-att-value="todo.id" + t-att-title="!todo.done ? 'Mark this task as done' : undefined" + t-att-checked="todo.done ? 'checked' : undefined"/> <t t-esc="todo.name"/> - <span class="ui-icon ui-icon-closethick" - title="Cancel task, remove it from list"/> </li> </ul></dd> </t> |
