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

Installing module l10n_mx_edi File not found /opt/odoo/custom/src/enterprise/l10n_mx_edi_extended/data/l10n_mx_edi.res.locality.csv #447

Open
carlosecv opened this issue Feb 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@carlosecv
Copy link

Describe the bug

Trying to install this module tha has a hook.py l10n_mx_edi_extended cannot read the files because symbolic links inside docker container

To Reproduce

Affected versions: Odoo 17

Steps to reproduce the behavior:

  1. Install the module
  2. FileNotFoundError: File not found: /opt/odoo/custom/src/enterprise/l10n_mx_edi_extended/data/l10n_mx_edi.res.locality.csv

Expected behavior A clear and concise description of what you expected to happen.

The file exists and has correct permmisions so Debugging i found that when on code asks:

    csv_path = join(dirname(realpath(__file__)), 'data', 'l10n_mx_edi.res.locality.csv')
    
    Its given path:

/opt/odoo/custom/src/enterprise/l10n_mx_edi_extended

but is symbolic link to

/opt/odoo/auto/addons/l10n_mx_edi_extended

but not full path is a relative path :

/opt/odoo/auto/addons/l10n_mx_edi_extended ->../../custom/src/enterprise/l10n_mx_edi_extended

Additional context

Debugging I found that on l10n_mx_edi_extended/hooks.py on line 50:

==== Load l10n_mx_edi.res.locality ====

if not env['l10n_mx_edi.res.locality'].search_count([]):
    import wdb;wdb.set_trace()
    csv_path = join(dirname(realpath(__file__)), 'data', 'l10n_mx_edi.res.locality.csv')
    tariff_fraction_vals_list = []
    with file_open(csv_path, 'r') as csv_file:

Debugging:

csv_path
'/opt/odoo/custom/src/enterprise/l10n_mx_edi_extended/data/l10n_mx_edi.res.locality.csv'
exception
FileNotFoundError: File not found: /opt/odoo/custom/src/enterprise/l10n_mx_edi_extended/data/l10n_mx_edi.res.locality.csv
146μs
file_open('/opt/odoo/auto/addons/l10n_mx_edi_extended/data/l10n_mx_edi.res.locality.csv', 'r')
<_io.TextIOWrapper name='/opt/odoo/auto/addons/l10n_mx_edi_extended/data/l10n_mx_edi.res.locality.csv' mode='r' encoding='utf-8'>

Can we have a Full path link to addons to avoid this issue?
Recomendations?

I have tried to put the module on private directory but its the same behavour

@carlosecv carlosecv added the bug Something isn't working label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant