Files
odoo_source/addons/payment/tests/multicompany_common.py
T
Antoine Vandevenne (anv)andVictor Feyens 573ed74c12 [REF] payment, *: refactor online payments API
This commit replaces the old online payments API of the `payment`
module with the new one and adapts to it all the implementing modules.

See the merge commit for more details.

task-2085989
task-2119838
task-2165982
task-2289255

Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-03-30 09:25:51 +02:00

40 lines
1.3 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo.fields import Command
from odoo.addons.payment.tests.common import PaymentCommon
_logger = logging.getLogger(__name__)
class PaymentMultiCompanyCommon(PaymentCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.company_a = cls.env.company
cls.company_b = cls.env['res.company'].create({'name': "Odoo Inc (TEST)"})
cls.user_company_a = cls.internal_user
cls.user_company_b = cls.env['res.users'].create({
'name': f"{cls.company_b.name} User (TEST)",
'login': 'user_company_b',
'password': 'user_company_b',
'company_id': cls.company_b.id,
'company_ids': [Command.set(cls.company_b.ids)],
'groups_id': [Command.link(cls.group_user.id)],
})
cls.user_multi_company = cls.env['res.users'].create({
'name': "Multi Company User (TEST)",
'login': 'user_multi_company',
'password': 'user_multi_company',
'company_id': cls.company_a.id,
'company_ids': [Command.set([cls.company_a.id, cls.company_b.id])],
'groups_id': [Command.link(cls.group_user.id)],
})
cls.acquirer_company_b = cls._prepare_acquirer(company=cls.company_b)