# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.addons.partner_invoicing_mode.tests.common import CommonPartnerInvoicingMode


class InvoiceModeAtShippingCommon(CommonPartnerInvoicingMode):
    @classmethod
    def setUpClass(cls):
        super().setUpClass()
        cls._create_order()

    @classmethod
    def _create_order(cls):
        cls.so1 = cls.env["sale.order"].create(
            {
                "partner_id": cls.partner.id,
                "partner_invoice_id": cls.partner.id,
                "partner_shipping_id": cls.partner.id,
                "order_line": [
                    (
                        0,
                        0,
                        {
                            "name": "Line one",
                            "product_id": cls.product.id,
                            "product_uom_qty": 4,
                            "product_uom": cls.product.uom_id.id,
                            "price_unit": 123,
                        },
                    )
                ],
            }
        )
