mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] reload form after matching wizard closes
[ADD] button to undo a split transaction
This commit is contained in:
@@ -47,6 +47,9 @@
|
||||
'wizard/banking_transaction_wizard.xml',
|
||||
'workflow/account_invoice.xml',
|
||||
],
|
||||
'js': [
|
||||
'static/src/js/account_banking.js',
|
||||
],
|
||||
'demo_xml': [],
|
||||
'external_dependencies': {
|
||||
'python' : ['BeautifulSoup'],
|
||||
|
||||
@@ -292,6 +292,12 @@
|
||||
<xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='amount']" position="after">
|
||||
<field name="match_type"/>
|
||||
<field name="residual"/>
|
||||
<field name="parent_id" invisible="1" />
|
||||
<button name="action_unlink"
|
||||
string="Remove split transaction"
|
||||
type="object"
|
||||
icon="STOCK_REMOVE"
|
||||
attrs="{'invisible': ['|', ('parent_id', '=', False), ('state', '!=', 'draft')]}" />
|
||||
<button name="match_wizard" states="draft"
|
||||
string="Match"
|
||||
icon="terp-gtk-jump-to-ltr"
|
||||
|
||||
@@ -1986,6 +1986,10 @@ class account_bank_statement_line(osv.osv):
|
||||
|
||||
return child_statement_ids
|
||||
|
||||
def action_unlink(self, cr, uid, ids, context=None):
|
||||
self.unlink(cr, uid, ids, context=context)
|
||||
return True
|
||||
|
||||
account_bank_statement_line()
|
||||
|
||||
class account_bank_statement(osv.osv):
|
||||
|
||||
51
account_banking/static/src/js/account_banking.js
Normal file
51
account_banking/static/src/js/account_banking.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/*############################################################################
|
||||
#
|
||||
# Copyright (C) 2013 Therp BV (<http://therp.nl>).
|
||||
#
|
||||
# All other contributions are (C) by their respective contributors
|
||||
#
|
||||
# All Rights Reserved
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract EduSense BV
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################################*/
|
||||
|
||||
openerp.account_banking = function(openerp)
|
||||
{
|
||||
var _t = openerp.web._t;
|
||||
openerp.web.Dialog.include(
|
||||
{
|
||||
on_close: function()
|
||||
{
|
||||
this._super.apply(this, arguments);
|
||||
if(this.dialog_title == _t("Match transaction"))
|
||||
{
|
||||
if(this.widget_parent.widget_children[0].views.form.controller)
|
||||
{
|
||||
this.widget_parent.widget_children[0].views.form.controller.reload();
|
||||
}
|
||||
if(this.widget_parent.widget_children[0].views.page.controller)
|
||||
{
|
||||
this.widget_parent.widget_children[0].views.page.controller.reload();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user