[15.0][MIG] contract_payment_mode: Migration to 15.0

This commit is contained in:
Palkesh
2022-03-28 17:09:55 +05:30
committed by sygel
parent 282f4c8a94
commit 640e947e6e
32 changed files with 81 additions and 119 deletions

View File

@@ -3,9 +3,13 @@
# Copyright 2017 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from unittest.mock import patch
import odoo.tests
from odoo.tests import tagged
from odoo.addons.account.models.account_payment_method import AccountPaymentMethod
from ..hooks import post_init_hook
@@ -14,9 +18,28 @@ class TestContractPaymentInit(odoo.tests.HttpCase):
def setUp(self):
super().setUp()
self.payment_method = self.env["account.payment.method"].create(
{"name": "Test Payment Method", "code": "Test", "payment_type": "inbound"}
Method_get_payment_method_information = (
AccountPaymentMethod._get_payment_method_information
)
def _get_payment_method_information(self):
res = Method_get_payment_method_information(self)
res["Test"] = {"mode": "multi", "domain": [("type", "=", "bank")]}
return res
with patch.object(
AccountPaymentMethod,
"_get_payment_method_information",
_get_payment_method_information,
):
self.payment_method = self.env["account.payment.method"].create(
{
"name": "Test Payment Method",
"code": "Test",
"payment_type": "inbound",
}
)
self.payment_mode = self.env["account.payment.mode"].create(
{
"name": "Test payment mode",