diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index c74ca5f833a..36aa8660bc4 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -782,9 +782,16 @@ class account_voucher(osv.osv):
vals[key].update(res[key])
return vals
+ def button_proforma_voucher(self, cr, uid, ids, context=None):
+ context = context or {}
+ wf_service = netsvc.LocalService("workflow")
+ for vid in ids:
+ wf_service.trg_validate(uid, 'account.voucher', vid, 'proforma_voucher', cr)
+ return {'type': 'ir.actions.act_window_close'}
+
def proforma_voucher(self, cr, uid, ids, context=None):
self.action_move_line_create(cr, uid, ids, context=context)
- return {'type': 'ir.actions.act_window_close'}
+ return True
def action_cancel_draft(self, cr, uid, ids, context=None):
wf_service = netsvc.LocalService("workflow")
diff --git a/addons/account_voucher/invoice.py b/addons/account_voucher/invoice.py
index 14b725cbeca..91ba438756e 100644
--- a/addons/account_voucher/invoice.py
+++ b/addons/account_voucher/invoice.py
@@ -27,11 +27,12 @@ class invoice(osv.osv):
def invoice_pay_customer(self, cr, uid, ids, context=None):
if not ids: return []
+ mod,modid = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_dialog_form')
inv = self.browse(cr, uid, ids[0], context=context)
return {
'name':_("Pay Invoice"),
'view_mode': 'form',
- 'view_id': False,
+ 'view_id': modid,
'view_type': 'form',
'res_model': 'account.voucher',
'type': 'ir.actions.act_window',
@@ -41,13 +42,13 @@ class invoice(osv.osv):
'context': {
'default_partner_id': inv.partner_id.id,
'default_amount': inv.type in ('out_refund', 'in_refund') and -inv.residual or inv.residual,
- 'default_name':inv.name,
+ 'default_number':inv.name,
'close_after_process': True,
- 'invoice_type':inv.type,
- 'invoice_id':inv.id,
+ 'invoice_type': inv.type,
+ 'invoice_id': inv.id,
'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment',
'type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment'
- }
+ }
}
invoice()
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index 65bcdad8a9b..c4fe05060d0 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -284,6 +284,111 @@
+
+ account.voucher.receipt.dialog.form
+ account.voucher
+ 30
+
+
+
+
+
+
account.voucher.receipt.form
account.voucher
@@ -297,7 +402,7 @@
-
+