diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 6e698c32434..4fe7bb7eae4 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -62,6 +62,7 @@ module named account_voucherss
'wizard/account_central_journal_view.xml',
'wizard/account_subscription_generate_view.xml',
'wizard/account_fiscalyear_close_view.xml',
+ 'wizard/account_state_open_view.xml',
'project/wizard/project_account_analytic_line_view.xml',
'account_view.xml',
'account_end_fy.xml',
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index feeb38dd51b..84e94b62a99 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -201,7 +201,7 @@
-
+
@@ -290,7 +290,7 @@
-
+
diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml
index 46fb98e820b..c3a67180918 100644
--- a/addons/account/account_wizard.xml
+++ b/addons/account/account_wizard.xml
@@ -102,7 +102,7 @@
-
+
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index f1f5eff907f..8fde393885f 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -50,7 +50,7 @@ import wizard_move_line_select
import wizard_validate_account_move
import wizard_use_model
-import wizard_state_open
+import account_state_open
import wizard_statement_from_invoice
import account_print_journal
diff --git a/addons/account/wizard/account_state_open.py b/addons/account/wizard/account_state_open.py
new file mode 100644
index 00000000000..17776f3279f
--- /dev/null
+++ b/addons/account/wizard/account_state_open.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 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 .
+#
+##############################################################################
+
+from osv import osv, fields
+
+import netsvc
+from tools.translate import _
+
+class account_state_open(osv.osv_memory):
+ _name = 'account.state.open'
+ _description = 'Account State Open'
+
+ def change_inv_state(self, cr, uid, ids, context=None):
+ obj_invoice = self.pool.get('account.invoice')
+ if context is None:
+ context = {}
+ if 'active_ids' in context:
+ data_inv = obj_invoice.browse(cr, uid, context['active_ids'][0], context=context)
+ if data_inv.reconciled:
+ raise osv.except_osv(_('Warning'), _('Invoice is already reconciled'))
+ wf_service = netsvc.LocalService("workflow")
+ res = wf_service.trg_validate(uid, 'account.invoice', context['active_ids'][0], 'open_test', cr)
+ return {}
+
+account_state_open()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_state_open_view.xml b/addons/account/wizard/account_state_open_view.xml
new file mode 100644
index 00000000000..3ed71949b2a
--- /dev/null
+++ b/addons/account/wizard/account_state_open_view.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Account State Open
+ account.state.open
+ form
+
+
+
+
+
+
+ Account State Open
+ ir.actions.act_window
+ account.state.open
+ form
+ form
+
+ {'record_id' : active_id}
+ new
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/wizard_state_open.py b/addons/account/wizard/wizard_state_open.py
deleted file mode 100644
index 9720f48e25e..00000000000
--- a/addons/account/wizard/wizard_state_open.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 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 wizard
-import pooler
-import netsvc
-from tools.translate import _
-
-form = '''
-'''
-
-fields = {
-}
-
-def _change_inv_state(self, cr, uid, data, context):
- pool_obj = pooler.get_pool(cr.dbname)
- data_inv = pool_obj.get('account.invoice').browse(cr, uid, data['ids'][0])
- if data_inv.reconciled:
- raise wizard.except_wizard(_('Warning'), _('Invoice is already reconciled'))
- wf_service = netsvc.LocalService("workflow")
- res = wf_service.trg_validate(uid, 'account.invoice', data['ids'][0], 'open_test', cr)
- return {}
-
-class wiz_state_open(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','No','gtk-no'),('yes','Yes','gtk-yes')]}
- },
- 'yes': {
- 'actions': [_change_inv_state],
- 'result': {'type':'state', 'state':'end'}
- }
- }
-wiz_state_open('account.wizard_paid_open')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: