Skip to content

[10.0] Make server_environment_files optional - #1425

Merged
yvaucher merged 1 commit into
OCA:10.0from
acsone:10.0-server_environment_optional_file-lmi
Nov 16, 2018
Merged

yvaucher merged 1 commit into
OCA:10.0from
acsone:10.0-server_environment_optional_file-lmi

Conversation

@lmignon

@lmignon lmignon commented Nov 13, 2018

Copy link
Copy Markdown
Contributor

Backport of OCA/server-env@d9ad47f

On 9.0 the same kind of change has been implemented by f0b8682

@lmignon
lmignon force-pushed the 10.0-server_environment_optional_file-lmi branch from ec092d5 to ff3d867 Compare November 13, 2018 15:06
@lmignon

lmignon commented Nov 13, 2018

Copy link
Copy Markdown
Contributor Author


try:
from odoo.addons import server_environment_files
_dir = os.path.dirname(server_environment_files.__file__)

@moylop260 moylop260 Nov 15, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about using
ck_path = odoo.modules.module.get_resource_path('server_environment_files', system_base_config['running_env'])?

Another question, if I'm not using this module but it is declared in the addons-path then will raise an error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@moylop260 Thank you for the review. The change is a backport of a commit from 11.0 (OCA/server-env@d9ad47f)

What about using
ck_path = odoo.modules.module.get_resource_path('server_environment_files', system_base_config['running_env'])?

system_base_config['running_env']will fail since the section is only required when you use server_environment_files.

Another question, if I'm not using this module but it is declared in the addons-path then will raise an error?

IMO Yes it will raise an error.
https://travis-ci.org/OCA/server-auth/jobs/454436281#L747

@lmignon

lmignon commented Nov 16, 2018

Copy link
Copy Markdown
Contributor Author

@OCA/server-environment-maintainers Someone to review this one?

@yvaucher

Copy link
Copy Markdown
Member

I don't think I can count @sbidoul double approval to merge right now 😉

Nevertheless I will fast track it as it is a backport.

@yvaucher
yvaucher merged commit eccfdf9 into OCA:10.0 Nov 16, 2018
@sbidoul
sbidoul deleted the 10.0-server_environment_optional_file-lmi branch November 16, 2018 20:12
SiesslPhillip pushed a commit to grueneerde/OCA-server-tools that referenced this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants