Files
Odoo-18.0-20251222/sale_partner_incoterm/tests/test_sale_partner_incoterm.py
tocmo0nlord adbe430761
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled
Initial commit: Odoo 18.0-20251222 extra-addons
2026-03-13 20:43:25 +00:00

22 lines
896 B
Python
Executable File

# Copyright 2015 Opener B.V. (<https://opener.am>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import Form, TransactionCase
class TestSalePartnerIncoterm(TransactionCase):
def test_sale_partner_incoterm(self):
"""
Check that the customer's default incoterm is retrieved in the
sales order's onchange
"""
customer = self.env.ref("base.res_partner_3")
incoterm = self.env["account.incoterms"].search([], limit=1)
address = self.env["res.partner"].search([], limit=1)
customer.write(
{"sale_incoterm_id": incoterm.id, "sale_incoterm_address_id": address.id}
)
sale_order = Form(self.env["sale.order"])
sale_order.partner_id = customer
self.assertEqual(sale_order.incoterm, incoterm)
self.assertEqual(sale_order.incoterm_address_id, address)