Skip to Content
Menú
This question has been flagged
1 Respondre
2731 Vistes

While developing a custom payment.provider, How to set Default payment journal as "bank".

Avatar
Descartar
Best Answer

Hi,
Inherit the payment.provider and add this code

 code = fields.Selection(selection_add=[('paytabs', 'paytabs')],
                            ondelete={'paytabs': 'set default'},
                            help="The technical code of this payment provider",
                            string="Code")

@api.model

def _get_payment_method_information(self):

"""Override to add create test payment method information to the

existing methods.

"""

res = super()._get_payment_method_information()

res['paytabs'] = {'mode': 'unique', 'domain': [('type', '=', 'bank')]}

return res
After completing these steps, your custom payment provider should appear on the list of available payment providers, and you can set the journal to "bank" as specified in your code.

Hope it helps

Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
de febr. 25
4917
0
de maig 24
1486
3
de gen. 25
3544
2
de juny 25
2133
1
de set. 24
2367