Initial commit: Odoo 18.0-20251222 extra-addons
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

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import test_sale_stock

View File

@@ -0,0 +1,72 @@
# Copyright 2018 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.fields import Command
from odoo.addons.sale.tests.common import TestSaleCommonBase
class TestSaleStock(TestSaleCommonBase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.company = cls.env["res.company"].create(
{
"name": "Test Company",
"currency_id": cls.env.ref("base.EUR").id,
}
)
cls.company_data = cls.setup_sale_configuration_for_company(cls.company)
cls.partner = cls.env["res.partner"].create(
{
"name": "partner1",
"company_id": False,
}
)
def test_sale_order_priority(self):
sale_order_priority = "1"
self.sale_order = self.env["sale.order"].create(
{
"partner_id": self.partner.id,
"priority": sale_order_priority,
"company_id": self.company.id,
"order_line": [
Command.create(
{
"name": self.company_data["product_order_cost"].name,
"product_id": self.company_data["product_order_cost"].id,
"product_uom_qty": 2,
"qty_delivered": 1,
"product_uom": self.company_data[
"product_order_cost"
].uom_id.id,
"price_unit": self.company_data[
"product_order_cost"
].list_price,
},
),
],
}
)
sale_order_line_priority = "0"
for sol in self.sale_order.order_line:
# Test that the order's priority has been
# correctly assigned to the order lines
self.assertEqual(
sol.priority,
sale_order_priority,
"Priority of order lines does not match",
)
sol.priority = sale_order_line_priority
# Confirm the order and check the picking
self.sale_order.action_confirm()
# Test that the lines' priority has been
# correctly assigned to the generated pickings
self.assertEqual(
max(self.sale_order.picking_ids.mapped("priority")),
sale_order_line_priority,
"Priority of generated picking does not match",
)