@@ -65,14 +65,14 @@ def test_paid_apps_hidden_when_enabled(self):
65
65
"""Test that paid apps are hidden when setting is enabled"""
66
66
# Enable hiding paid apps
67
67
self .IrConfigParam .set_param ("openspp.hide_paid_apps" , "True" )
68
-
69
- # Search for modules in Apps context
70
- modules = self . Module . with_context ( apps_menu = True ). search ([])
71
-
72
- # Check that our test paid modules are NOT visible, but free module is
73
- self .assertNotIn (self .paid_module_oeel , modules , "OEEL test module should be hidden when setting is enabled" )
74
- self .assertNotIn (self .paid_module_opl , modules , "OPL test module should be hidden when setting is enabled" )
75
- self .assertIn (self .free_module , modules , "Free module should still be visible" )
68
+ # Use web API read for Apps UI (filtered)
69
+ result = self . Module . with_context ( apps_menu = True ). web_search_read (
70
+ domain = [], specification = { "name" : {}, "license" : {}}
71
+ )
72
+ names = { r [ "name" ] for r in result [ "records" ]}
73
+ self .assertNotIn (self .paid_module_oeel . name , names , "OEEL test module should be hidden when setting is enabled" )
74
+ self .assertNotIn (self .paid_module_opl . name , names , "OPL test module should be hidden when setting is enabled" )
75
+ self .assertIn (self .free_module . name , names , "Free module should still be visible" )
76
76
77
77
def test_paid_apps_visible_outside_apps_menu (self ):
78
78
"""Test that paid apps remain visible in module management views"""
@@ -87,19 +87,12 @@ def test_paid_apps_visible_outside_apps_menu(self):
87
87
self .assertIn (self .paid_module_opl , modules , "OPL test module should be visible outside apps menu" )
88
88
self .assertIn (self .free_module , modules , "Free module should be visible outside apps menu" )
89
89
90
- def test_search_methods_respect_setting (self ):
90
+ def test_ui_search_methods_respect_setting (self ):
91
91
"""Test that all search methods respect the hide paid apps setting"""
92
92
# Enable hiding paid apps
93
93
self .IrConfigParam .set_param ("openspp.hide_paid_apps" , "True" )
94
94
95
- # Test _search method
96
95
domain = [("application" , "=" , True )]
97
- module_ids = self .Module .with_context (apps_menu = True )._search (domain )
98
-
99
- # Our test paid modules should not be in results
100
- self .assertNotIn (self .paid_module_oeel .id , module_ids , "_search should filter OEEL apps" )
101
- self .assertNotIn (self .paid_module_opl .id , module_ids , "_search should filter OPL apps" )
102
- self .assertIn (self .free_module .id , module_ids , "_search should not filter free apps" )
103
96
104
97
# Test search_fetch method
105
98
modules = self .Module .with_context (apps_menu = True ).search_fetch (domain , ["name" , "license" ])
@@ -141,7 +134,7 @@ def test_edge_cases_with_none_license(self):
141
134
# Module with no license should be visible
142
135
self .assertIn (no_license_module , modules , "Modules with no license should be visible" )
143
136
144
- def test_paid_license_variations (self ):
137
+ def test_paid_license_variations_filtered_in_ui (self ):
145
138
"""Test that different variations of paid licenses are filtered"""
146
139
# Create modules with various paid license formats
147
140
oeel_variations = [
@@ -173,9 +166,10 @@ def test_paid_license_variations(self):
173
166
# Enable hiding paid apps
174
167
self .IrConfigParam .set_param ("openspp.hide_paid_apps" , "True" )
175
168
176
- # Search for modules in Apps context
177
- modules = self .Module .with_context (apps_menu = True ).search ([])
178
-
179
- # All paid license variations should be hidden
169
+ # UI web read should filter paid license variants
170
+ result = self .Module .with_context (apps_menu = True ).web_search_read (
171
+ domain = [], specification = {"name" : {}, "license" : {}}
172
+ )
173
+ names = {r ["name" ] for r in result ["records" ]}
180
174
for module in oeel_variations + opl_variations :
181
- self .assertNotIn (module , modules , f"Module with license { module .license } should be hidden" )
175
+ self .assertNotIn (module . name , names , f"Module with license { module .license } should be hidden" )
0 commit comments