This question has been flagged
2368 Views

Hi ,

We had a requirement to improve the user experience on moving to the payment page after invoice validation. I need to customise the invoice to payment page navigation so that on validation of an account invoice, the user can be taken directly to customer payment page (Customers/Customer Payments/Create), instead of making multiple clicks by going to "Customer Payments",click on 'create' and then search for customer

I tried to override the invoice_validate method in account_invoice which does seem to forward but throw up some UI errors:

 def invoice_validate(self, cr, uid, ids, context=None):
    self.write(cr, uid, ids, {'state':'open'}, context=context)
    mod_obj = self.pool.get('ir.model.data')
    res = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
    res_id = res and res[1] or False,
    return {
        'view_type': 'form',
        'view_mode': 'form',
        'view_id': res_id,
        'res_model': 'account.voucher',
        'type': 'ir.actions.act_window',
        'target': 'current',
        }

Was curious to know if Iam in the right path or is there a better way to do this ?(using workflow or other mechanisms) . Any help is appreciated

Avatar
Discard