Skip to content

Commit d66f6d7

Browse files
OpenSPP Minor Fixes (#861)
* [FIX] spp_change_request_change_info: filter validator * [FIX] spp_change_request_change_info: filter validator * [FIX] include fix on other CR Types * [ADD] logger to check error * [FIX] col checker for lang * [REM] logger * [ADD] requirement of field to prevent empty lines * [REM] workbook type * [FIX] make spmis base an app * [FIX] force save activity_ids * [FIX] force save activity_ids * [FIX] add logger on vals to check error * [FIX] add logger to check error * [FIX] remove constrain * [FIX] add logger to check error * [IMP] record rule and remove loggers * [IMP] record rule * [ADD] the constrain * [REM] record rule for now * [ADD] access rights to common read, write, create * [FIX] cr groups access * [FIX] pre-commit * [ADD] filter targeting * [ADD] filter targeting * [ADD] logger on fields get * [FIX] setting of searchables * [ADD] logger on fields view get * [FIX] setting of searchables * [FIX] setting of searchables * [FIX] setting of searchables * [ADD] logger * [FIX] remove _get_view * [FIX] relationships view * [FIX] relationships view * [ADD] constraints on relation * [FIX] constraints on relation * [FIX] constraints on relation * [FIX] constraints on relation * [FIX] requirement on xml * [IMP] error message * [IMP] error message * [FIX] disable adding if not yet created * [FIX] Relationship to Relation Types * [FIX] Relationship to Relation Types * [FIX] Relationship to Relation Types * [FIX] Duplicate Relation error message * [FIX] hide disabled for now * [MOVE] fixes for relationships on spmis, social * [MOVE] fixes for relationships on spmis, social * [IMP] error message * [IMP] page string * [IMP] season view * [IMP] season actions * [FIX] season actions and land record access * [IMP] season actions * [FIX] land record access * [IMP] name get and compute display name * [FIX] hiding of relation types menu * [FIX] hiding of relation types menu * [IMP] remove the added dependency * [FIX] requirement of species to a constraint * [FIX] remove requirements of species on view * [FIX] season menu * [ADD] logger to check if the queue really started * [ADD] logger to check if the queue really started * [FIX] lessen the ceiling of batches * [FIX] lessen the ceiling of batches * [FIX] lessen the ceiling of batches * [FIX] use the variable across job creation * [IMP] optimization of area importing * [FIX] importing of areas * [FIX] spp_area_base: tests * [FIX] spp_area, spp_area_gis: tests * Potential fix for code scanning alert no. 3: Clear-text logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * [FIX] tests * [FIX] tests * [FIX] tests --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 3daab1a commit d66f6d7

59 files changed

Lines changed: 2210 additions & 609 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jsonschema
1010
jwcrypto>=1.5.6
1111
numpy>=1.22.2
1212
openpyxl
13+
pandas
1314
pyjwt>=2.4.0
1415
pyproj
1516
python-magic

‎spp_area/tests/__init__.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# Part of OpenG2P Registry. See LICENSE file for full copyright and licensing details.
22

3-
from . import common
43
from . import test_area
5-
from . import test_area_import
6-
from . import test_area_import_raw
74
from . import test_res_partner

‎spp_area/tests/common.py‎

Lines changed: 0 additions & 51 deletions
This file was deleted.
-41.1 KB
Binary file not shown.
-11.9 KB
Binary file not shown.

‎spp_area/tests/test_area.py‎

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22

33
import logging
44

5-
# from odoo.tests import tagged
65
from odoo.tests.common import TransactionCase
76

87
_logger = logging.getLogger(__name__)
98

109

11-
# @tagged("post_install", "-at_install")
1210
class AreaTest(TransactionCase):
1311
@classmethod
1412
def setUpClass(cls):
1513
super().setUpClass()
14+
# Set context to avoid job queue delay for faster tests
15+
cls.env = cls.env(
16+
context=dict(
17+
cls.env.context,
18+
test_queue_job_no_delay=True,
19+
)
20+
)
1621

1722
# Initial Setup of Variables
1823
cls.area_1 = cls.env["spp.area"].create(
@@ -28,6 +33,43 @@ def setUpClass(cls):
2833
)
2934

3035
def test_01_check_childs(self):
36+
"""Test that parent area correctly computes child areas"""
3137
self.area_1._compute_get_childs()
3238

3339
self.assertEqual(len(self.area_1.child_ids), 1)
40+
41+
def test_02_check_area_creation(self):
42+
"""Test basic area creation"""
43+
area = self.env["spp.area"].create(
44+
{
45+
"draft_name": "Test Area 2",
46+
}
47+
)
48+
self.assertTrue(area)
49+
self.assertEqual(area.draft_name, "Test Area 2")
50+
51+
def test_03_check_parent_child_relationship(self):
52+
"""Test parent-child relationship in areas"""
53+
# Check parent has child
54+
self.assertIn(self.area_1_child, self.area_1.child_ids)
55+
56+
# Check child has parent
57+
self.assertEqual(self.area_1_child.parent_id, self.area_1)
58+
59+
def test_04_create_multi_level_hierarchy(self):
60+
"""Test creating multiple levels of area hierarchy"""
61+
# Create level 2 child
62+
area_grandchild = self.env["spp.area"].create(
63+
{
64+
"draft_name": "Testing Area Grandchild",
65+
"parent_id": self.area_1_child.id,
66+
}
67+
)
68+
69+
# Verify hierarchy
70+
self.assertEqual(area_grandchild.parent_id, self.area_1_child)
71+
self.assertEqual(area_grandchild.parent_id.parent_id, self.area_1)
72+
73+
# Check parent has grandchild in descendants
74+
self.area_1._compute_get_childs()
75+
self.assertIn(self.area_1_child, self.area_1.child_ids)

‎spp_area/tests/test_area_import.py‎

Lines changed: 0 additions & 140 deletions
This file was deleted.

‎spp_area/tests/test_area_import_raw.py‎

Lines changed: 0 additions & 75 deletions
This file was deleted.

‎spp_area/tests/test_res_partner.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ class ResPartnerTest(TransactionCase):
77
@classmethod
88
def setUpClass(cls):
99
super().setUpClass()
10+
# Set context to avoid job queue delay for faster tests
11+
cls.env = cls.env(
12+
context=dict(
13+
cls.env.context,
14+
test_queue_job_no_delay=True,
15+
)
16+
)
1017
cls._create_test_data()
1118

1219
@classmethod

0 commit comments

Comments
 (0)