Friday, October 6, 2023
1 change · master
Enhancements to existing features
This update replaces older internal ways of locating and opening module files with newer methods that include stronger safety checks. It helps ensure files are only accessed from approved Odoo add-on locations, reducing risk while keeping existing business behavior unchanged.
Original PR description
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