diff --git a/purchase_product_pack/tests/test_purchase_product_pack.py b/purchase_product_pack/tests/test_purchase_product_pack.py index b8a2b4df4..53cf8a0d4 100644 --- a/purchase_product_pack/tests/test_purchase_product_pack.py +++ b/purchase_product_pack/tests/test_purchase_product_pack.py @@ -1,6 +1,5 @@ # Copyright 2023 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) - from odoo.tests.common import TransactionCase from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT @@ -291,31 +290,10 @@ def test_order_line_totalized_with_seller(self): (self.purchase_order.order_line - line).mapped("price_subtotal"), [0, 0, 0] ) - def get_seller_cost(self): + def test_get_seller_cost_no_line(self): product_tp = self.env.ref("product_pack.product_pack_cpu_detailed_totalized") - product_product_16 = self.env.ref("product.product_product_16") - product_product_16.write( - { - "seller_ids": [ - ( - 0, - 0, - { - "partner_id": self.env.ref("base.res_partner_12").id, - "min_qty": 1.0, - "price": 20.0, - }, - ) - ] - } - ) - line = self.env["purchase.order.line"].create( - { - "order_id": self.purchase_order.id, - "name": product_tp.name, - "product_id": product_tp.id, - "product_qty": 10, - } - ) - cost = line.get_seller_cost(False) - self.assertEqual(cost, 205.0) # standard_price (20.5) * quantity (10) \ No newline at end of file + # Consult the price of the product without a purchase order line + prices = product_tp.pack_cost_compute(False) + cost = prices[product_tp.id] + self.assertEqual(cost, 2596.0) + # standard_price (20.5) * quantity (126.63414634146341463414634146341)