[IMP] reload form after matching wizard closes

[ADD] button to undo a split transaction
This commit is contained in:
Holger Brunn
2013-04-24 11:21:01 +02:00
parent 822a32cbe9
commit fb3a8ee4f9
4 changed files with 64 additions and 0 deletions

View File

@@ -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'],

View File

@@ -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"

View File

@@ -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):

View 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();
}
}
},
});
}