From 48c3104836f5dccf0e36ac8e22ce3c2c30319b73 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 17 Sep 2012 11:55:18 +0200 Subject: [PATCH] wip bzr revid: nicolas.vanhoren@openerp.com-20120917095518-fco1enwa3yl7mo2b --- .../static/src/js/account_move_reconciliation.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 9d61152d6a6..9e4b9fd30dd 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -9,10 +9,11 @@ openerp.account = function (instance) { instance.web.account.ReconciliationListView = instance.web.ListView.extend({ init: function() { this._super.apply(this, arguments); + this.current_partner = null; }, on_loaded: function() { var tmp = this._super.apply(this, arguments); - this.$el.prepend(QWeb.render("AccountReconciliation")); + this.$el.prepend(QWeb.render("AccountReconciliation", {widget: self})); return tmp; }, do_search: function(domain, context, group_by) { @@ -26,14 +27,13 @@ openerp.account = function (instance) { self.partners = _.chain(result).pluck("attributes").pluck("value") .filter(function(el) {return !!el;}).value(); self.current_partner = self.partners.length == 0 ? null : 0; - return self.search_by_partner(self.current_partner); - + self.search_by_partner(); }); }, - search_by_partner: function(partner) { - return this.old_search(new instance.web.CompoundDomain(this.last_domain, [["partner_id", "in", partner === null ? [] : [this.partners[partner][0]] ]]), - this.last_context, this.last_group_by); - } + search_by_partner: function() { + return this.old_search(new instance.web.CompoundDomain(this.last_domain, [["partner_id", "in", this.current_partner === null ? [] : + [this.partners[this.current_partner][0]] ]]), this.last_context, this.last_group_by); + }, }); /*instance.web.views.add('form_clone', 'instance.account.extend_form_view');