From 031ccce1504e3d058a1855551543cfc6b724d2f9 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 5 Sep 2012 13:41:42 +0530 Subject: [PATCH] [FIX] account: account reconciliation JS, return false if not datarecord on click on reconciliation, nothing reconciliation buttons bzr revid: hmo@tinyerp.com-20120905081142-6zdw8cs919v0l0j8 --- .../account/static/src/js/account_move_reconciliation.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 680eca18374..88b263038b4 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -36,6 +36,9 @@ instance.account.extend_form_view = instance.web.FormView.extend({ }, do_reconcilation:function(event){ var self = this + if (!self.datarecord.id){ + return false; + } var list_view = this.getParent().views['list'].controller ids = list_view.get_selected_ids() if (ids.length == 0) { @@ -66,6 +69,9 @@ instance.account.extend_form_view = instance.web.FormView.extend({ do_nothing_to_reconcile:function(){ var self = this; + if (!self.datarecord.id){ + return false; + } this.dataset.call(event.target.name, [[self.datarecord.id], self.dataset.context]).then(function() { self.dataset.read_slice().done(function(){ self.on_pager_action('next'); @@ -91,6 +97,7 @@ instance.account.extend_form_view = instance.web.FormView.extend({ on_pager_action: function(action) { var self = this + if (this.dataset.ids.length == 0){ self.datarecord = {} _(this.fields).each(function (field, f) {