mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-21 17:12:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
from . import test_pos_container_deposit
|
||||
from . import test_pos_container_deposit_frontend
|
||||
|
|
@ -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"])
|
||||
|
|
@ -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",
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue