Skip to content

Commit b1030ec

Browse files
[MIG] intrastat_product_hscodes_import: Migration to 19.0
1 parent c7deea3 commit b1030ec

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

intrastat_product_hscodes_import/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "Intrastat Product - HS Codes Import",
6-
"version": "18.0.1.0.0",
6+
"version": "19.0.1.0.0",
77
"category": "Intrastat",
88
"license": "AGPL-3",
99
"summary": "Module used to import HS Codes for Intrastat Product",

intrastat_product_hscodes_import/wizards/intrastat_hscodes_import_installer.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from openpyxl import load_workbook
44

5-
from odoo import _, fields, models, tools
5+
from odoo import fields, models, tools
66
from odoo.exceptions import MissingError, UserError
77

88
UOM_MAPPING = {
@@ -80,7 +80,7 @@ def _import_local_codes(self, uom_map):
8080
iu = uom_map[raw_code]
8181
iu_unit_id = self._get_mapped_uom_id(iu)
8282
if not iu_unit_id:
83-
raise UserError(_("Unit not found: '%s'") % iu)
83+
raise UserError(self.env._("Unit not found: '%s'", iu))
8484
vals["intrastat_unit_id"] = iu_unit_id
8585
vals_list.append(vals)
8686
if vals_list:
@@ -104,12 +104,14 @@ def _import_country_specific_descriptions(self, code_obj):
104104
f"intrastat_product_hscodes_import/data/countries/{filename}"
105105
)
106106
if not file_path:
107-
raise MissingError(f"Missing language file for code '{short_code}'")
107+
raise MissingError(
108+
self.env._("Missing language file for code '%s'", short_code)
109+
)
108110
sheet, header = self._read_excel_sheet(file_path)
109111
indent_index = header.index("Indent")
110112
description_index = header.index("Description")
111113
goods_code_index = header.index("Goods code")
112-
all_codes = code_obj.search_read([], ["id", "local_code"])
114+
all_codes = code_obj.search_read([], ["id", "local_code"]) # pylint: disable=W8163
113115
code_map = {
114116
rec["local_code"].replace(" ", "")[:8]: rec["id"] for rec in all_codes
115117
}

0 commit comments

Comments
 (0)