[IMP] account_payment_sale: Remove dependancies on demo data on tests

This commit is contained in:
Enric Tobella
2024-12-23 21:59:42 +01:00
committed by Weblate
parent b40786a690
commit 6adc81cee9
2 changed files with 33 additions and 4 deletions

View File

@@ -53,8 +53,22 @@ class CommonTestCase(TransactionCase):
}
)
cls.products = {
"prod_order": cls.env.ref("product.product_order_01"),
"prod_del": cls.env.ref("product.product_delivery_01"),
"prod_order": cls.env["product.product"].create(
{
"name": "Test product order",
"detailed_type": "consu",
"list_price": 280,
"standard_price": 235,
}
),
"prod_del": cls.env["product.product"].create(
{
"name": "Test product delivery",
"detailed_type": "consu",
"list_price": 70,
"standard_price": 55,
}
),
"serv_order": cls.env["product.product"].create(
{
"name": "Test service product order",

View File

@@ -92,7 +92,14 @@ class TestSaleOrder(CommonTestCase):
{
"advance_payment_method": "fixed",
"fixed_amount": 5,
"product_id": self.env.ref("sale.advance_product_0").id,
"product_id": self.env["product.product"]
.create(
{
"name": "Deposit",
"type": "service",
}
)
.id,
"sale_order_ids": order,
}
)
@@ -113,7 +120,15 @@ class TestSaleOrder(CommonTestCase):
Expected result:
Two invoices should be generated
"""
payment_mode_2 = self.env.ref("account_payment_mode.payment_mode_outbound_dd1")
payment_mode_2 = self.env["account.payment.mode"].create(
{
"name": "Direct Debit of suppliers from Société Générale",
"bank_account_link": "variable",
"payment_method_id": self.env.ref(
"account.account_payment_method_manual_out"
).id,
}
)
order_1 = self.create_sale_order()
order_2 = self.create_sale_order(payment_mode_2)
orders = order_1 | order_2