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,2 @@
from . import test_pos_container_deposit
from . import test_pos_container_deposit_frontend

View file

@ -0,0 +1,49 @@
# Copyright 2024 Hunki Enterprises BV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestPosDeposit(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.deposit_product = cls.env.ref("pos_container_deposit.demo_deposit_product")
cls.product = cls.env.ref("pos_container_deposit.demo_product")
cls.product_template = cls.product.product_tmpl_id
def test_product_behavior(self):
"""
Test that product search, write, copy behaves as expected with deposit products
"""
self.assertIn(
self.product,
self.env["product.product"].search(
[
("deposit_product_id", "=", self.deposit_product.id),
]
),
)
self.assertIn(
self.product_template,
self.env["product.template"].search(
[
("deposit_product_id", "=", self.deposit_product.id),
]
),
)
self.product_template.deposit_product_id = False
self.assertFalse(self.product.deposit_product_id)
self.product.deposit_product_id = self.deposit_product
self.assertEqual(self.product_template.deposit_product_id, self.deposit_product)
product2 = self.product.copy({})
self.assertEqual(product2.deposit_product_id, self.deposit_product)
self.assertEqual(self.product_template.deposit_product_id, self.deposit_product)
template2 = self.product_template.copy()
self.assertEqual(template2.deposit_product_id, self.deposit_product)
def test_pos_session(self):
"""
Be sure the extra field and domain are included
"""
params = self.env["pos.session"]._loader_params_product_product()
self.assertIn("deposit_product_id", params["search_params"]["fields"])

View file

@ -0,0 +1,14 @@
from odoo.tests.common import tagged
from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon
@tagged("post_install", "-at_install")
class TestPosContainerDeposit(TestPointOfSaleHttpCommon):
def run_tour(self):
self.main_pos_config.open_ui()
self.start_tour(
"/pos/ui?config_id=%d" % self.main_pos_config.id,
"pos_container_deposit.test_tour",
login="accountman",
)