Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Payment method creation

By
Md. Tanzilul Hasan Khan
on 11/20/16, 7:54 AM 163 views

I am trying to create a payment method where no payment is required. Customer will pay on delivery. So, I need to confirm sales when pay now is created. I have written following codes -


class payment_acquirer_extend(osv.Model):
    _inherit = 'payment.acquirer'
    def _get_providers(self, cr, uid, context=None):
        providers = super(payment_acquirer_extend, self)._get_providers(cr, uid, context=context)
providers.append(['cash', _('Cash on Delivery')])
 return providers
    def transfer_get_form_action_url(self, cr, uid, id, context=None):
        return '/payment/transfer/feedback'
    def create(self, cr, uid, values, context=None):
        if values.get('provider') == 'cash' and not values.get('post_msg'):
            values['post_msg'] = 'CASH DELIVERY'
return super(payment_acquirer_extend, self).create(cr, uid, values, context=context)


Now I understand I have to write following function:

cash_form_generate_values

How to do that and if I click on pay now button it doesn't work?


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/20/16, 7:54 AM
Seen: 163 times
Last updated: 11/20/16, 8:37 AM