Vauxoo / pylint-odoo

1 stars 4 forks source link

[master] pylint-odoo: AttributeError: 'ModuleChecker' object has no attribute 'odoo_module_name' #66

Closed KarenKawaii closed 8 years ago

KarenKawaii commented 8 years ago

Module: checkers

Version: master

Steps to reproduce:

  1. Update the big image: docker pull vauxoo/odoo-80-image-shippable-auto
  2. Create a new image and container for a project using t2d (assuming the steps to do).
  3. Enter to the container and run the command to check pylint with the --rcfile= and --load-plugins=, e.g.:
[root@415a1619937c]~/build/Vauxoo/lodigroup/lodi_export_inventory/wizard$
 (8.0)$ pylint --rcfile=/.repo_requirements/linit_hook/travis/cfg/travis_run_pylint.cfg --load-plugins=pylint_odoo ./*

Environment You can check that the pylint and astro versions are ok.

[root@415a1619937c]~/build/Vauxoo/lodigroup/lodi_export_inventory/wizard$
 (8.0)$ pylint --version
No config file found, using default configuration
pylint 2.0.0, 
astroid 1.5.0
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2]

Current behaviour lodigroup-wizard-no-attribute-odoo-module-name

Error

  File "/usr/local/lib/python2.7/dist-packages/pylint_odoo/checkers/modules_odoo.py", line 231, in check_odoo_relative_import
    if self.odoo_module_name in self._get_odoo_module_imported(node):
AttributeError: 'ModuleChecker' object has no attribute 'odoo_module_name'

The previous error affects the pylint_odoo checks showed by syntastic into vim too.

Twelve days ago, everything was working ok.

Note: I made the proper tests making containers and the changes related to the newest [IMP] into docker-odoo-image odoo-shippable thay have nothing to do with this error.

Expected behaviour The command working fine when you are into the subdirectories of the module, not only passing the command when you are into the root of the module. e.g.: Able to run this command

[root@415a1619937c]~/build/Vauxoo/lodigroup/lodi_export_inventory$
 (8.0)$ pylint --rcfile=/.repo_requirements/linit_hook/travis/cfg/travis_run_pylint_vim.cfg --load-plugins=pylint_odoo ./*

Need to be able for run this command too.

[root@415a1619937c]~/build/Vauxoo/lodigroup/lodi_export_inventory/wizard$
 (8.0)$ pylint --rcfile=/.repo_requirements/linit_hook/travis/cfg/travis_run_pylint_vim.cfg --load-plugins=pylint_odoo .

If this command doesn't show an error the problems to show the pylint_odoo checks into vim would be resolved.

KarenKawaii commented 8 years ago

Hi @moylop260 I think this issue is related to the new check odoo-addons-relative-import that has to get the odoo_module_name. If you try to run the command into the module subdirectories the function cannot get the odoo_module_name and that is a problem inside the editor vim and outside of it.

What do you think?

moylop260 commented 8 years ago

Thanks confirmed I'll check it

KarenKawaii commented 8 years ago

Thanks to you @moylop260