Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2753 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lut 25
4950
0
maj 24
1511
3
sty 25
3613
2
cze 25
2150
1
wrz 24
2385