跳至内容
菜单
此问题已终结
1 回复
2863 查看

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

形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
3
2月 25
5107
0
5月 24
1609
3
1月 25
4813
2
6月 25
2314
1
9月 24
2467