Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,3 @@
from . import test_brand
from . import test_brand_mixin
from . import common

View file

@ -0,0 +1,24 @@
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
@tagged("post_install", "-at_install")
class CommonCase(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.brand_model = cls.env["res.brand"]
cls.company_model = cls.env["res.company"]
cls.partner_model = cls.env["res.partner"]
cls.company_no_brand = cls.company_model.create({"name": "No Brand Company"})
cls.company_optional_brand = cls.company_model.create(
{"name": "Optional Brand Company", "brand_use_level": "optional"}
)
cls.company_required_brand = cls.company_model.create(
{"name": "Required Brand Company", "brand_use_level": "required"}
)
cls.partner = cls.partner_model.create({"name": "Test Partner"})
cls.brand = cls.brand_model.create({"partner_id": cls.partner.id})

View file

@ -0,0 +1,8 @@
from .common import CommonCase
class TestBrandMixin(CommonCase):
def test_brand_creation(self):
"""Test creation of a brand."""
brand = self.brand_model.create({"partner_id": self.partner.id})
self.assertTrue(brand.exists())

View file

@ -0,0 +1,13 @@
from lxml import etree
from .common import CommonCase
class TestBrand(CommonCase):
def test_get_view(self):
view = self.env["res.config.settings"].get_view(
view_id=self.env.ref("base.res_config_settings_view_form").id,
view_type="form",
)
doc = etree.XML(view["arch"])
self.assertTrue(doc.xpath("//field[@name='brand_use_level']"))