-
-
Notifications
You must be signed in to change notification settings - Fork 153
[18.0] [FIX] connector_importer: use the original value for the unique key if not mapped #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @simahawk, |
f8f4c8f to
467300e
Compare
simahawk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: