From 432601cb7ec9f30629df0b290cccddf0a5a0c1ef Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 5 Sep 2012 13:21:20 +0530 Subject: [PATCH] [FIX] account: reconciliation form , set false if not data bzr revid: hmo@tinyerp.com-20120905075120-kcf31riknnaha8v0 --- .../src/js/account_move_reconciliation.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 8196779fa1d..3d046f99312 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -86,20 +86,22 @@ instance.account.extend_form_view = instance.web.FormView.extend({ var self = this var viewmanager = self.getParent(); viewmanager.action.context.next_partner_only = true; - //TODO: if no records, than it's not working, it giving error if (this.dataset.ids.length == 0){ - self.dataset.index = null; + self.datarecord = {} viewmanager.action.context.partner_id = []; viewmanager.searchview.do_search(); - self.reload(); - return + _(this.fields).each(function (field, f) { + field.set_value(self.datarecord[f] || false); + }); + self.do_update_pager(); + } + else{ + $.when(this._super(action)).then(function() { + var id = self.get_fields_values().partner_id; + viewmanager.action.context.partner_id = [id]; + viewmanager.searchview.do_search(); + }); } - - $.when(this._super(action)).then(function() { - var id = self.get_fields_values().partner_id; - viewmanager.action.context.partner_id = [id]; - viewmanager.searchview.do_search(); - }); }, })