diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py
index 9bb04b9272d..a41ebd2f13f 100644
--- a/addons/account_payment/__openerp__.py
+++ b/addons/account_payment/__openerp__.py
@@ -38,6 +38,7 @@
'update_xml': [
'security/account_payment_security.xml',
'security/ir.model.access.csv',
+ 'wizard/wizard_pay_view.xml',
'payment_wizard.xml',
'wizard/account_payment_create_order_view.xml',
'payment_view.xml',
@@ -45,6 +46,7 @@
'payment_sequence.xml',
'account_invoice_view.xml',
'payment_report.xml',
+
],
'demo_xml': [],
'installable': True,
diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml
index f25655a317c..b7d4262a2ca 100644
--- a/addons/account_payment/payment_view.xml
+++ b/addons/account_payment/payment_view.xml
@@ -162,7 +162,7 @@
-
+
diff --git a/addons/account_payment/payment_wizard.xml b/addons/account_payment/payment_wizard.xml
index ceb9c928596..bc2f02eb0a8 100644
--- a/addons/account_payment/payment_wizard.xml
+++ b/addons/account_payment/payment_wizard.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/addons/account_payment/wizard/wizard_pay.py b/addons/account_payment/wizard/wizard_pay.py
index 7380cadb685..74e1566520c 100644
--- a/addons/account_payment/wizard/wizard_pay.py
+++ b/addons/account_payment/wizard/wizard_pay.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,54 +15,46 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-
-import wizard
-from osv import osv
-import pooler
-from osv import fields
import time
+from osv import fields, osv
+
+class account_payment_make_payment(osv.osv_memory):
+ _name = 'account.payment.make.payment'
+ _description = 'Account make payment'
+ _columns = {
+ }
+
+ def launch_wizard(self, cr, uid, ids, context):
+ """
+ Search for a wizard to launch according to the type.
+ If type is manual. just confirm the order.
+ """
+ obj_payment_order = self.pool.get('payment.order')
+ obj_model = self.pool.get('ir.model.data')
+ obj_act = self.pool.get('ir.actions.act_window')
+ order= obj_payment_order.browse(cr,uid,context['active_id'],context)
+ t= order.mode and order.mode.type.code or 'manual'
+ if t == 'manual' :
+ obj_payment_order.set_done(cr,uid,context['active_id'],context)
+ return {}
+
+ gw= obj_payment_order.get_wizard(t)
+ if not gw:
+ obj_payment_order.set_done(cr,uid,context['active_id'],context)
+ return {}
+
+ module, wizard= gw
+ result = mod_obj._get_id(cr, uid, module, wizard)
+ id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
+ result = act_obj.read(cr, uid, [id])[0]
+ #result['context'] = str({'fiscalyear': data['form']['fiscalyear']})
+ return result
-def _launch_wizard(self, cr, uid, data, context):
- """
- Search for a wizard to launch according to the type.
- If type is manual. just confirm the order.
- """
-
- order_ref= pooler.get_pool(cr.dbname).get('payment.order')
- order= order_ref.browse(cr,uid,data['id'],context)
- t= order.mode and order.mode.type.code or 'manual'
- if t == 'manual' :
- order_ref.set_done(cr,uid,data['id'],context)
- return {}
-
- gw= order_ref.get_wizard(t)
- if not gw:
- order_ref.set_done(cr,uid,data['id'],context)
- return {}
-
- mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
- act_obj = pooler.get_pool(cr.dbname).get('ir.actions.wizard')
- module, wizard= gw
- result = mod_obj._get_id(cr, uid, module, wizard)
- id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
- result = act_obj.read(cr, uid, [id])[0]
- #result['context'] = str({'fiscalyear': data['form']['fiscalyear']})
- return result
-
-
-class wizard_pay(wizard.interface):
-
- states= {'init' : {'actions': [],
- 'result':{'type':'action',
- 'action':_launch_wizard,
- 'state':'end'}
- }
- }
-wizard_pay('pay_payment')
+account_payment_make_payment()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_payment/wizard/wizard_pay_view.xml b/addons/account_payment/wizard/wizard_pay_view.xml
new file mode 100644
index 00000000000..061c152361c
--- /dev/null
+++ b/addons/account_payment/wizard/wizard_pay_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ account.payment.make.payment.form
+ account.payment.make.payment
+ form
+
+
+
+
+
+
+ Make Payment
+ ir.actions.act_window
+ account.payment.make.payment
+ form
+ form
+
+ new
+
+
+
+
+