Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2874 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
feb 25
5131
0
mag 24
1611
3
gen 25
4958
2
giu 25
2321
1
set 24
2476