[18.0] [FIX] connector_importer: use the original value for the unique key if not mapped#175
Conversation
|
Hi @simahawk, |
f8f4c8f to
467300e
Compare
simahawk
left a comment
There was a problem hiding this comment.
any chance to have updated tests? 😁
|
I didn't find my way into the existing tests :/ |
The test is here https://github.com/OCA/connector-interfaces/blob/18.0/connector_importer/tests/test_record_importer.py#L76 The mapper here https://github.com/OCA/connector-interfaces/blob/18.0/connector_importer/tests/fake_components.py#L8 You could simply add a |
467300e to
fa53b46
Compare
…f not mapped
```python-trackeback
File ".../connector-interfaces/connector_importer/models/record.py", line 94, in import_record
return importer.run(
^^^^^^^^^^^^^
File ".../connector-interfaces/connector_importer/components/importer.py", line 355, in run
skip_info = self.skip_it(values, line)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../connector-interfaces/connector_importer/components/importer.py", line 237, in skip_it
msg += f": {self.unique_key}={values[self.unique_key]}"
~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'id'
```
fa53b46 to
1fd7394
Compare
|
Unit test added. |
|
/ocabot merge patch |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 33a5f31. Thanks a lot for contributing to OCA. ❤️ |
Using options like this:
And a sample file like this: