diff --git a/base_export_manager/models/ir_exports_line.py b/base_export_manager/models/ir_exports_line.py index 30492b6e12..7ecb0a2d75 100644 --- a/base_export_manager/models/ir_exports_line.py +++ b/base_export_manager/models/ir_exports_line.py @@ -138,6 +138,10 @@ def _inverse_name(self): one.with_context(skip_check=True)[one.field_n(num, True)] = False continue field_name = parts[num - 1] + # Odoo make difference between bank_ids/.id and bank_ids/id, the + # former refer to xml id the second the postgresql id column + # here we want to find the id field is user request for `.id` + field_name = field_name.replace(".id", "id") model = one.model_n(num) # You could get to failing constraint while populating the # fields, so we skip the uniqueness check and manually check diff --git a/base_export_manager/tests/test_ir_exports.py b/base_export_manager/tests/test_ir_exports.py index d9626fc497..6206f13af4 100644 --- a/base_export_manager/tests/test_ir_exports.py +++ b/base_export_manager/tests/test_ir_exports.py @@ -17,10 +17,12 @@ def test_create_with_basic_data(self): "name": "Test éxport", "resource": "ir.exports", "export_fields": [ + [0, 0, {"name": ".id"}], [0, 0, {"name": "export_fields"}], [0, 0, {"name": "export_fields/create_uid"}], [0, 0, {"name": "export_fields/create_date"}], [0, 0, {"name": "export_fields/field1_id"}], + [0, 0, {"name": "export_fields/field1_id/.id"}], ], } virt_record = self.env["ir.exports"].new(data)