mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
@@ -14,25 +14,30 @@ class TestPaymentOrderInboundBase(SavepointCase):
|
||||
def setUpClass(cls):
|
||||
self = cls
|
||||
super().setUpClass()
|
||||
self.env.user.company_id = self.env.ref("base.main_company").id
|
||||
self.inbound_mode = self.env.ref(
|
||||
"account_payment_mode.payment_mode_inbound_dd1"
|
||||
)
|
||||
self.invoice_line_account = self.env["account.account"].search(
|
||||
[
|
||||
(
|
||||
"user_type_id",
|
||||
"=",
|
||||
self.env.ref("account.data_account_type_revenue").id,
|
||||
)
|
||||
],
|
||||
limit=1,
|
||||
self.invoice_line_account = self.env["account.account"].create(
|
||||
{
|
||||
"name": "Test account",
|
||||
"code": "TEST1",
|
||||
"user_type_id": self.env.ref("account.data_account_type_revenue").id,
|
||||
"tax_ids": [
|
||||
(4, self.env.ref("l10n_generic_coa.1_sale_tax_template").id)
|
||||
],
|
||||
}
|
||||
)
|
||||
self.journal = self.env["account.journal"].search(
|
||||
[("type", "=", "bank")], limit=1
|
||||
self.journal = self.env["account.journal"].create(
|
||||
{"name": "Test journal", "code": "BANK", "type": "bank"}
|
||||
)
|
||||
self.inbound_mode.variable_journal_ids = self.journal
|
||||
# Make sure no others orders are present
|
||||
self.domain = [("state", "=", "draft"), ("payment_type", "=", "inbound")]
|
||||
self.domain = [
|
||||
("state", "=", "draft"),
|
||||
("payment_type", "=", "inbound"),
|
||||
("company_id", "=", self.env.user.company_id.id),
|
||||
]
|
||||
self.payment_order_obj = self.env["account.payment.order"]
|
||||
self.payment_order_obj.search(self.domain).unlink()
|
||||
# Create payment order
|
||||
|
||||
@@ -11,6 +11,7 @@ from odoo.tests.common import TransactionCase
|
||||
class TestPaymentOrderOutbound(TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestPaymentOrderOutbound, self).setUp()
|
||||
self.env.user.company_id = self.env.ref("base.main_company").id
|
||||
self.journal = self.env["account.journal"].search(
|
||||
[("type", "=", "bank")], limit=1
|
||||
)
|
||||
@@ -22,7 +23,8 @@ class TestPaymentOrderOutbound(TransactionCase):
|
||||
"user_type_id",
|
||||
"=",
|
||||
self.env.ref("account.data_account_type_expenses").id,
|
||||
)
|
||||
),
|
||||
("company_id", "=", self.env.user.company_id.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
@@ -35,10 +37,15 @@ class TestPaymentOrderOutbound(TransactionCase):
|
||||
"account_payment_mode.payment_mode_outbound_dd1"
|
||||
)
|
||||
self.bank_journal = self.env["account.journal"].search(
|
||||
[("type", "=", "bank")], limit=1
|
||||
[("type", "=", "bank"), ("company_id", "=", self.env.user.company_id.id)],
|
||||
limit=1,
|
||||
)
|
||||
# Make sure no other payment orders are in the DB
|
||||
self.domain = [("state", "=", "draft"), ("payment_type", "=", "outbound")]
|
||||
self.domain = [
|
||||
("state", "=", "draft"),
|
||||
("payment_type", "=", "outbound"),
|
||||
("company_id", "=", self.env.user.company_id.id),
|
||||
]
|
||||
self.env["account.payment.order"].search(self.domain).unlink()
|
||||
|
||||
def _create_supplier_invoice(self):
|
||||
|
||||
Reference in New Issue
Block a user