[REF] payment_*: adapt to payment changes
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
from . import models
|
||||
from . import controllers
|
||||
|
||||
from odoo.addons.payment import reset_payment_acquirer
|
||||
from odoo.addons.payment import setup_provider, reset_payment_acquirer
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
setup_provider(cr, registry, 'sips')
|
||||
|
||||
|
||||
def uninstall_hook(cr, registry):
|
||||
|
||||
@@ -19,6 +19,7 @@ not guaranteed.""",
|
||||
'data/payment_acquirer_data.xml',
|
||||
],
|
||||
'application': True,
|
||||
'post_init_hook': 'post_init_hook',
|
||||
'uninstall_hook': 'uninstall_hook',
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
|
||||
@@ -6,10 +6,4 @@
|
||||
<field name="redirect_form_view_id" ref="redirect_form"/>
|
||||
</record>
|
||||
|
||||
<record id="payment_method_sips" model="account.payment.method">
|
||||
<field name="name">Sips</field>
|
||||
<field name="code">sips</field>
|
||||
<field name="payment_type">inbound</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import account_payment_method
|
||||
from . import payment_acquirer
|
||||
from . import payment_transaction
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class AccountPaymentMethod(models.Model):
|
||||
_inherit = 'account.payment.method'
|
||||
|
||||
@api.model
|
||||
def _get_payment_method_information(self):
|
||||
res = super()._get_payment_method_information()
|
||||
res['sips'] = {'mode': 'unique', 'domain': [('type', '=', 'bank')]}
|
||||
return res
|
||||
@@ -55,12 +55,6 @@ class PaymentAcquirer(models.Model):
|
||||
shasign = sha256((data + key).encode('utf-8'))
|
||||
return shasign.hexdigest()
|
||||
|
||||
def _get_default_payment_method_id(self):
|
||||
self.ensure_one()
|
||||
if self.provider != 'sips':
|
||||
return super()._get_default_payment_method_id()
|
||||
return self.env.ref('payment_sips.payment_method_sips').id
|
||||
|
||||
def _neutralize(self):
|
||||
super()._neutralize()
|
||||
self._neutralize_fields('sips', ['sips_merchant_id', 'sips_secret'])
|
||||
|
||||
@@ -6,8 +6,8 @@ from odoo.addons.payment.tests.common import PaymentCommon
|
||||
class SipsCommon(PaymentCommon):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls, chart_template_ref=None):
|
||||
super().setUpClass(chart_template_ref=chart_template_ref)
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
||||
cls.sips = cls._prepare_acquirer('sips', update_values={
|
||||
'sips_merchant_id': 'dummy_mid',
|
||||
|
||||
Reference in New Issue
Block a user