Skip to content
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

[14.0][FIX] connector_importer: skip_fields_unchanged #136

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

raumschmiede-joshuaL
Copy link

@raumschmiede-joshuaL raumschmiede-joshuaL commented Jun 21, 2024

When skip_fields_unchanged is set for the record handler, the behaviour comparing existing with new values raises an error because read returns a list and another one, that id is not in values.
And the operator is wrong. Currently it would import the values only if they are the same as the existing.

I added a FIXME for later to convert the new values. Is this ok?

@OCA-git-bot
Copy link
Contributor

Hi @simahawk,
some modules you are maintaining are being modified, check this out!

@raumschmiede-joshuaL
Copy link
Author

@i-vyshnevska

@raumschmiede-joshuaL
Copy link
Author

Shall I update the module version?

@raumschmiede-joshuaL raumschmiede-joshuaL changed the title [FIX] connector_importer: skip_fields_unchanged [14.0][FIX] connector_importer: skip_fields_unchanged Jun 21, 2024
@vuwnevska
Copy link

Shall I update the module version?

this will be done by bot on merge

for k, v in current_values.items():
if values[k] != v:
# FIXME: New value can be "1" and existing 1. Needs field conversion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably use field's convert_to_read w/ use_name_get=False

@@ -71,3 +71,31 @@ def test_find_domain(self):
self.assertEqual(
domain, [("name", "=", values["name"]), ("age", "=", values["age"])]
)

def test_odoo_write_purge_values(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding a test! 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants