Skip to content

Commit eda56a5

Browse files
committed
Revert "merge from 17.0"
This reverts commit 05677df.
1 parent 05677df commit eda56a5

File tree

26 files changed

+155
-614
lines changed

26 files changed

+155
-614
lines changed

spp_area/models/area_import.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -202,32 +202,6 @@ def create_import_raw(self, vals, column_indexes, row, sheet):
202202
}
203203
)
204204

205-
def check_all_languages_activated(self, columns, area_level):
206-
"""Check if all languages in the specified columns are activated.
207-
208-
Args:
209-
columns (list): The list of column names to check.
210-
area_level (int): The administrative area level to check within the column names.
211-
212-
Raises:
213-
ValidationError: If any language is not active.
214-
"""
215-
self.ensure_one()
216-
prefix = f"ADM{area_level}_"
217-
active_langs = self.env["res.lang"].search([("active", "=", True)]).mapped("iso_code")
218-
219-
for col in columns:
220-
if col.startswith(prefix):
221-
lang = col.split("_", 1)[1]
222-
if len(lang) == 2 and lang.lower() not in active_langs:
223-
raise ValidationError(
224-
_(
225-
"Language with ISO Code %s is not active.\n"
226-
"Please request the administrator to enable the desired language."
227-
)
228-
% lang.upper()
229-
)
230-
231205
def import_data(self):
232206
"""
233207
The `import_data` function imports data from an Excel file, processes it, and updates the record
@@ -263,8 +237,6 @@ def import_data(self):
263237
# get column list of sheet
264238
columns = sheet.row_values(0)
265239

266-
rec.check_all_languages_activated(columns, area_level)
267-
268240
column_indexes = rec.get_column_indexes(columns, area_level)
269241

270242
# Get the required values for area in each row

spp_area/tests/test_area_import.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import logging
22

3-
from odoo.exceptions import ValidationError
4-
53
from .common import AreaImportTestMixin
64

75
_logger = logging.getLogger(__name__)
@@ -19,13 +17,8 @@ def test_02_reset_to_uploaded(self):
1917
self.assertEqual(self.area_import_id.state, "Uploaded")
2018

2119
def test_03_import_data(self):
22-
with self.assertRaises(ValidationError):
23-
self.area_import_id.import_data()
24-
25-
lang = self.env["res.lang"].with_context(active_test=False).search([("iso_code", "=", "ar")])
26-
lang.active = True
27-
2820
self.area_import_id.import_data()
21+
2922
raw_data_ids = self.area_import_id.raw_data_ids
3023

3124
self.assertEqual(len(raw_data_ids.ids), self.area_import_id.tot_rows_imported)
@@ -38,12 +31,6 @@ def test_03_import_data(self):
3831

3932
def test_04_validate_raw_data(self):
4033
# Greater than or equal to 400 rows
41-
with self.assertRaises(ValidationError):
42-
self.area_import_id.import_data()
43-
44-
lang = self.env["res.lang"].with_context(active_test=False).search([("iso_code", "=", "ar")])
45-
lang.active = True
46-
4734
self.area_import_id.import_data()
4835
self.area_import_id.validate_raw_data()
4936

@@ -76,11 +63,6 @@ def test_04_validate_raw_data(self):
7663

7764
def test_05_save_to_area(self):
7865
# Greater than or equal to 400 rows
79-
with self.assertRaises(ValidationError):
80-
self.area_import_id.import_data()
81-
lang = self.env["res.lang"].with_context(active_test=False).search([("iso_code", "=", "ar")])
82-
lang.active = True
83-
8466
self.area_import_id.import_data()
8567
self.area_import_id.save_to_area()
8668

spp_dashboard_base/__init__.py

Whitespace-only changes.

spp_dashboard_base/__manifest__.py

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

spp_dashboard_base/pyproject.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.
-12.3 KB
Binary file not shown.

spp_dashboard_base/static/src/card_board/card_board.js

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

spp_dashboard_base/static/src/card_board/card_board.xml

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

spp_dashboard_base/static/src/chart/chart.js

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

spp_dashboard_base/static/src/chart/chart.xml

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

0 commit comments

Comments
 (0)