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/js/dashboard.js | |
| 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/js/dashboard.js')
| -rw-r--r-- | addons/base_dashboard/static/src/js/dashboard.js | 19 |
1 files changed, 9 insertions, 10 deletions
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' |
