odoo/odoo#135607
Created by Security, Martin Trigaux (mat)
Merged
at 22ab49e3432b9342b657b9f8f4cf2d06b083ddad
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Overridden by @odony
Linked pull requests
- label
- odoo-dev:master-deprecate-module-paths-mat
- head
- d34189183e19bf7f32fb6c38c60d138adea89a63
- merged
- 2 years ago by Security, Martin Trigaux (mat)
odoo/odoo | odoo/enterprise | odoo/upgrade | |
---|---|---|---|
master | #135607 | #47475 | #5187 |
[IMP] use file_path and file_open
Deprecate the usage of get_resource_path
/get_module_resource
. Using file_path
has the same features with additional security checks.
Replace all the deprecated calls to open
or get_resource_path
with the file_open
and file_path
method.
Differences between get_resource_path
and file_path
:
- get_resource_path
returns False if the file does not exsits, file_path
raises a FileNotFoundError
- file_path
ensures the file is within the addons-path
Difference between open
and file_open
- file_open
ensures the file is within the addons-path