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

[MIG] connector_importer_source_sftp: Migration to 16.0 #138

Open
wants to merge 20 commits into
base: 16.0
Choose a base branch
from

Conversation

p-tombez
Copy link

@p-tombez p-tombez commented Aug 29, 2024

ref: BSALLO-1566

@p-tombez p-tombez force-pushed the 16.0-mig-connector_importer_source_sftp branch 3 times, most recently from 4914e5c to d8a7499 Compare August 29, 2024 09:51
@@ -1 +1,2 @@
odoo-test-helper
mock
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not needed. Just change the import of mock to from unittest import mock 😉

Copy link
Author

Choose a reason for hiding this comment

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

It IS needed because this depends on storage_backend_sftp, which also requires mock.
See https://github.com/OCA/connector-interfaces/actions/runs/10612682197/job/29414865086#step:8:209

Copy link
Contributor

Choose a reason for hiding this comment

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

it is NOT because that's broken there too. It has been migrated in the wrong way. There's no need for such dep. Trust me 😉

Copy link
Contributor

@simahawk simahawk Sep 4, 2024

Choose a reason for hiding this comment

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

in red the wrong ones

image

Copy link
Contributor

Choose a reason for hiding this comment

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

There you go OCA/storage#388

@simahawk simahawk force-pushed the 16.0-mig-connector_importer_source_sftp branch from d8a7499 to b72af96 Compare September 4, 2024 05:25
@simahawk
Copy link
Contributor

simahawk commented Sep 4, 2024

FTR I couldn't replicate the failing test on the event listener locally

2024-09-04 05:27:22,457 260 ERROR odoo odoo.tests.suite: ERROR: setUpClass (odoo.addons.connector_importer_source_sftp.tests.test_event_listener.TestRecordImporterFinishedEvent)
Traceback (most recent call last):
  File "/__w/connector-interfaces/connector-interfaces/connector_importer_source_sftp/tests/test_event_listener.py", line 25, in setUpClass
    cls.recordset.write(
  File "/opt/odoo-venv/lib/python3.10/site-packages/odoo/addons/component_event/models/base.py", line 109, in write
    result = super(Base, self).write(vals)
  File "/opt/odoo/odoo/models.py", line 3784, in write
    field.write(self, value)
  File "/opt/odoo/odoo/fields.py", line 1125, in write
    cache_value = self.convert_to_cache(value, records)
  File "/opt/odoo/odoo/fields.py", line 2735, in convert_to_cache
    raise ValueError("Wrong value for %s: %r" % (self, value))
ValueError: Wrong value for import.recordset.source_model: 'import.source.csv.sftp'

Looks weird because the selection option should be already there.

@simahawk
Copy link
Contributor

simahawk commented Sep 4, 2024

Ok. it fails only if you run tests at db creation.

They must run at post_install to make sure the new source type is registered.

Fixes:

```
odoo.tests.suite: ERROR: setUpClass (odoo.addons.connector_importer_source_sftp.tests.test_event_listener.TestRecordImporterFinishedEvent)
Traceback (most recent call last):
  File "/__w/connector-interfaces/connector-interfaces/connector_importer_source_sftp/tests/test_event_listener.py", line 25, in setUpClass
    cls.recordset.write(
  File "/opt/odoo-venv/lib/python3.10/site-packages/odoo/addons/component_event/models/base.py", line 109, in write
    result = super(Base, self).write(vals)
  File "/opt/odoo/odoo/models.py", line 3784, in write
    field.write(self, value)
  File "/opt/odoo/odoo/fields.py", line 1125, in write
    cache_value = self.convert_to_cache(value, records)
  File "/opt/odoo/odoo/fields.py", line 2735, in convert_to_cache
    raise ValueError("Wrong value for %s: %r" % (self, value))
ValueError: Wrong value for import.recordset.source_model: 'import.source.csv.sftp'
```
@simahawk
Copy link
Contributor

simahawk commented Sep 4, 2024

Great, this change 876c609 fixed tests locally but not here 😓

@leemannd
Copy link

leemannd commented Sep 6, 2024

I added a PR to update the dependency: p-tombez#1

IMP connector_importer_product update cryptography dep
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.

7 participants