Skip to content

Conversation

@gurneyalex
Copy link
Member

@gurneyalex gurneyalex commented Jun 23, 2025

  • fix stale warning
  • take care of the ADDONS_PATH conversion

closes: #82

@gurneyalex gurneyalex force-pushed the improve-convert branch 2 times, most recently from 4ee9ea8 to 748e6b3 Compare June 24, 2025 08:33
for line in old_env_lines:
new_line = (
line.replace(
"/odoo/src/addons", "/odoo/src/odoo/odoo/addons, /odoo/src/odoo/addons"
Copy link
Member

Choose a reason for hiding this comment

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

/odoo/src/odoo/odoo/addons I don't remember seeing it. It exists or is it a typo?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's the path of the base addons. Not sure why I had issues without this. I'll double check

Copy link
Member

Choose a reason for hiding this comment

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

/odoo/src/addons + /odoo/src/odoo/addons should be enough IMO, the other one doesn't exist

for line in old_env_lines:
new_line = (
line.replace(
"/odoo/src/addons", "/odoo/src/odoo/odoo/addons, /odoo/src/odoo/addons"
Copy link
Member

Choose a reason for hiding this comment

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

The replace seems strange. I may be missing something.

Copy link
Member Author

Choose a reason for hiding this comment

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

there is 1 directory in the "old style" image, and I had to replace it with the 2 addons directories of Odoo (addons/ and odoo/addons/ ) in the new style image

Copy link
Member

@leemannd leemannd left a comment

Choose a reason for hiding this comment

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

Looks good. I only have one point on which I'm not sure.

@gurneyalex gurneyalex added this to the 0.13.0 milestone Jun 30, 2025
Comment on lines 303 to +307
shutil.move("odoo/Dockerfile", "Dockerfile.bak")
old_env_lines = []
with open("Dockerfile.bak") as old_dockerfile:
found_env = False
for line in old_dockerfile:
Copy link
Contributor

Choose a reason for hiding this comment

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

Now pathlib is mandatory for this repo.

Suggested change
shutil.move("odoo/Dockerfile", "Dockerfile.bak")
old_env_lines = []
with open("Dockerfile.bak") as old_dockerfile:
found_env = False
for line in old_dockerfile:
old_dockerfile = Path("odoo/Dockerfile").rename("Dockerfile.bak")
new_dockerfile = Path("Dockerfile")
old_env_lines = []
found_env = False
with old_dockerfile.open() as fobj:
for line in fobj:

Comment on lines +317 to +319
with open("Dockerfile") as new_dockerfile:
found_env = False
for line in new_dockerfile:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
with open("Dockerfile") as new_dockerfile:
found_env = False
for line in new_dockerfile:
found_env = False
with new_dockerfile.open() as fobj:
for line in fobj:

Comment on lines +328 to +329
with open("Dockerfile", "w") as new_dockerfile:
new_dockerfile.writelines(new_docker_file_lines)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
with open("Dockerfile", "w") as new_dockerfile:
new_dockerfile.writelines(new_docker_file_lines)
with new_dockerfile.open("w") as fobj:
fobj.writelines(new_docker_file_lines)

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.

Conversion script: the addons path of the project is not preserved in the Dockerfile

4 participants