Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2791 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
feb. 25
5003
0
mai 24
1527
3
ian. 25
3812
2
iun. 25
2178
1
sept. 24
2407