[FIX] Friendly error message upon canceling a payment reconciliation

[FIX] Delete import transaction when statement line is deleted
This commit is contained in:
Stefan Rijnhart
2012-01-07 15:17:51 +01:00
parent 394b8a3cc9
commit 9ab01df94e
2 changed files with 17 additions and 6 deletions

View File

@@ -1,8 +1,11 @@
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# Copyright (C) 2011 Therp BV (<http://therp.nl>).
# Copyright (C) 2011 Smile (<http://smile.fr>).
# (C) 2011 Therp BV (<http://therp.nl>).
# (C) 2011 Smile (<http://smile.fr>).
#
# All other contributions are (C) by their own contributors
#
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
@@ -29,7 +32,7 @@
'name': 'Account Banking',
'version': '0.1.92',
'license': 'GPL-3',
'author': 'EduSense BV / Therp BV / Smile',
'author': 'Banking addons community',
'website': 'https://launchpad.net/banking-addons',
'category': 'Banking addons',
'depends': ['base', 'account', 'base_iban', 'account_payment'],

View File

@@ -630,9 +630,15 @@ class banking_import_transaction(osv.osv):
'date_done': transaction.effective_date,
}
)
return _reconcile_move(
self, cr, uid, transaction_id, context=context)
return self._reconcile_move(cr, uid, transaction_id, context=context)
def _cancel_payment(
self, cr, uid, transaction_id, context=None):
raise osv.except_osv(
_("Cannot unreconcile"),
_("Cannot unreconcile: this operation is not yet supported for "
"match type 'payment'"))
def _cancel_payment_order(
self, cr, uid, transaction_id, context=None):
"""
@@ -729,6 +735,7 @@ class banking_import_transaction(osv.osv):
'manual': _cancel_move,
'move': _cancel_move,
'payment_order': _cancel_payment_order,
'payment': _cancel_payment,
}
def cancel(self, cr, uid, ids, context=None):
if ids and isinstance(ids, (int, float)):
@@ -1540,7 +1547,8 @@ class banking_import_transaction(osv.osv):
'res.company', 'Company', required=True),
'duplicate': fields.boolean('duplicate'),
'statement_line_id': fields.many2one(
'account.bank.statement.line', 'Statement line'),
'account.bank.statement.line', 'Statement line',
ondelete='CASCADE'),
'statement_id': fields.many2one(
'account.bank.statement', 'Statement'),
'parent_id': fields.many2one(