Skip to content

Commit c4c8745

Browse files
authored
HSC-102: Fix issue with getting record by ID (#53)
1 parent f528bf7 commit c4c8745

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitpod.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tasks:
2+
- init: ./gradlew clean test

odoo_initializer/models/base_loader.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ def _pre_process(self, file_, mapping, filters_):
131131

132132
def _record_exist(self, record_id):
133133
cr = registry.cursor
134-
cr.execute("SELECT res_id FROM ir_model_data WHERE name='" + record_id + "';")
134+
db_mode,db_id = record_id.split('.', 1)
135+
cr.execute("SELECT res_id FROM ir_model_data WHERE name='" + db_id + "';")
135136
return cr.dictfetchall() or False
136137

137138
# Rule to delete a field that shouldn't be updated if found, from the record

odoo_initializer/tests/test_integration_loader.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def setUp(self):
1818
@staticmethod
1919
def _get_non_updated_groups():
2020
return [
21-
{"id": "group_test_1", "name": "test_1", "comment": "other"},
22-
{"id": "group_test_2", "name": "test_2", "comment": "filter"},
23-
{"id": "group_test_3", "name": "test_3", "comment": "other"},
21+
{"id": "init.group_test_1", "name": "test_1", "comment": "other"},
22+
{"id": "init.group_test_2", "name": "test_2", "comment": "filter"},
23+
{"id": "init.group_test_3", "name": "test_3", "comment": "other"},
2424
]
2525

2626
def test_load_file_should_import_records(self):

0 commit comments

Comments
 (0)