[FIX] reconcile view: use backbone event architecture, remove .add

bzr revid: rgaopenerp-20121019105304-9ddz8q763prmxdg0
This commit is contained in:
RGA(OpenERP) 2012-10-19 16:23:04 +05:30
parent 958b40a440
commit 96254074d7
1 changed files with 7 additions and 3 deletions

View File

@ -11,15 +11,15 @@ openerp.account = function (instance) {
this._super.apply(this, arguments); this._super.apply(this, arguments);
var self = this; var self = this;
this.current_partner = null; this.current_partner = null;
this.do_select.add(function() { this.on('record_selected', this, function(ids, records) {
if (self.get_selected_ids().length === 0) { if (ids.length === 0) {
self.$(".oe_account_recon_reconcile").attr("disabled", ""); self.$(".oe_account_recon_reconcile").attr("disabled", "");
} else { } else {
self.$(".oe_account_recon_reconcile").removeAttr("disabled"); self.$(".oe_account_recon_reconcile").removeAttr("disabled");
} }
}); });
}, },
on_loaded: function() { load_list: function() {
var self = this; var self = this;
var tmp = this._super.apply(this, arguments); var tmp = this._super.apply(this, arguments);
if (this.partners) { if (this.partners) {
@ -121,6 +121,10 @@ openerp.account = function (instance) {
self.do_search(self.last_domain, self.last_context, self.last_group_by); self.do_search(self.last_domain, self.last_context, self.last_group_by);
}); });
}, },
do_select: function (ids, records) {
this.trigger('record_selected', ids, records)
this._super.apply(this, arguments);
},
}); });
}; };