From 2ce07c97c615c405d2171244dd47f8b52edf8c73 Mon Sep 17 00:00:00 2001 From: kbh Date: Mon, 24 Oct 2011 14:47:30 +0530 Subject: [PATCH] [FIX] Fixed the issue of checkbutton select all/none in tree view. lp bug: https://launchpad.net/bugs/878108 fixed bzr revid: kbh@bde-desktop-20111024091730-dkzafro2f9e0k7tf --- addons/web/static/src/js/view_list.js | 8 +++++++- addons/web/static/src/xml/base.xml | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index d09ec1d3035..6fd4cdf2e03 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -201,8 +201,8 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# this.setup_columns(this.fields_view.fields, grouped); this.$element.html(QWeb.render("ListView", this)); - // Head hook + this.$element.find('#all_checked').click(this.do_all_checked); this.$element.find('.oe-list-add') .click(this.do_add_record) .attr('disabled', grouped && this.options.editable); @@ -269,6 +269,11 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# this.set_common_sidebar_sections(this.sidebar); } }, + + do_all_checked:function (ev) { + var all_checkbox = this.$element.find('.oe-record-selector :checkbox') + all_checkbox.attr('checked', !all_checkbox.attr('checked')); + }, /** * Configures the ListView pager based on the provided dataset's information * @@ -650,6 +655,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# $first_header.attr('colspan', parseInt(colspan, 10) + count); } // Padding for column titles, footer and data rows + var $rows = this.$element .find('.oe-listview-header-columns, tr:not(thead tr)') .not(options['except']); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7720ae2d38b..4c21a565a69 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -593,7 +593,8 @@ - + +