diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py
index d76f1881d71..d02011de47e 100644
--- a/addons/account_voucher/__openerp__.py
+++ b/addons/account_voucher/__openerp__.py
@@ -42,10 +42,11 @@
"voucher_workflow.xml",
"voucher_report.xml",
"wizard/account_voucher_open_view.xml",
+ "wizard/account_voucher_unreconcile_view.xml",
"voucher_view.xml",
"voucher_sales_purchase_view.xml",
"voucher_payment_receipt_view.xml",
- "voucher_wizard.xml"
+ "voucher_wizard.xml",
],
"test" : [
# "test/account_voucher.yml",
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index b204896917c..02c7d7dee57 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -53,6 +53,7 @@
+
@@ -134,6 +135,7 @@
+
diff --git a/addons/account_voucher/wizard/__init__.py b/addons/account_voucher/wizard/__init__.py
index bd436ecd135..a5c9a5e4f59 100644
--- a/addons/account_voucher/wizard/__init__.py
+++ b/addons/account_voucher/wizard/__init__.py
@@ -20,3 +20,4 @@
##############################################################################
import account_voucher_open
+import account_voucher_unreconcile
diff --git a/addons/account_voucher/wizard/account_voucher_unreconcile.py b/addons/account_voucher/wizard/account_voucher_unreconcile.py
new file mode 100644
index 00000000000..d12bee51894
--- /dev/null
+++ b/addons/account_voucher/wizard/account_voucher_unreconcile.py
@@ -0,0 +1,63 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import netsvc
+from osv import osv
+from osv import fields
+
+class account_voucher_unreconcile(osv.osv_memory):
+ _name = "account.voucher.unreconcile"
+ _description = "Account voucher unreconcile"
+
+ _columns = {
+ 'remove':fields.boolean('Want to remove accounting entries too ?', required=False),
+ }
+
+ _defaults = {
+ 'remove': lambda *a: True,
+ }
+
+ def trans_unrec(self, cr, uid, ids, context=None):
+ res = self.browse(cr, uid, ids[0])
+ if context is None:
+ context = {}
+ voucher_pool = self.pool.get('account.voucher')
+ reconcile_pool = self.pool.get('account.move.reconcile')
+ if context.get('active_id'):
+ voucher = voucher_pool.browse(cr, uid, context.get('active_id'), context)
+ recs = []
+ for line in voucher.move_ids:
+ if line.reconcile_id:
+ recs = [line.reconcile_id.id]
+
+ for rec in recs:
+ reconcile_pool.unlink(cr, uid, rec)
+
+ if res.remove:
+ voucher_pool.cancel_voucher(cr, uid, [context.get('active_id')], context)
+# wf_service = netsvc.LocalService("workflow")
+# wf_service.trg_validate(uid, 'account.voucher', context.get('active_id'), 'cancel_voucher', cr)
+
+ return {}
+
+account_voucher_unreconcile()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_voucher/wizard/account_voucher_unreconcile_view.xml b/addons/account_voucher/wizard/account_voucher_unreconcile_view.xml
new file mode 100644
index 00000000000..3f8dd9c4e32
--- /dev/null
+++ b/addons/account_voucher/wizard/account_voucher_unreconcile_view.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+ Account voucher unreconcile
+ account.voucher.unreconcile
+ form
+
+
+
+
+
+ Unreconcile entries
+ account.voucher.unreconcile
+ form
+ form
+
+ new
+
+
+
+
+
+
+
+
+
+
+
+