odoo-ide / pycharm-odoo

PyCharm plugin for Odoo
https://plugins.jetbrains.com/plugin/13499-odoo
Other
41 stars 5 forks source link

Unresolved references in non-module files #395

Closed jcfernandez-890825 closed 1 year ago

jcfernandez-890825 commented 1 year ago

For every odoo project, I have a miscellaneous folder where I have a list of python files having script like things that I run using Odoo shell:

venv/bin/python src/odoo/odoo-bin shell [...]

I was gonna use one of those scripts (See odoo15.zip attachment) today, when I saw a lot of errors and warnings: image

image

Any ideas?

odoo15e.zip

trinhanhngoc commented 1 year ago

Hi @jcfernandez-890825 I just attached your folder to my project. There are some unresolved reference errors but not as many as yours.

image

For files that are not in any modules, Odoo plugin will restrict the scope of symbol resolution to server-wide modules (base + web). I think I will improve this a bit in the next version by enlarging the scope to the project scope for better symbol resolution.

jcfernandez-890825 commented 1 year ago

@trinhanhngoc The thing is that I have more of this kind of files in this same folder, and I only get this errors when using the module model. For my purposes, the scope thing you mentioned only meant that I didn't get auto-complete suggestions when doing a self.env['some.module'], but Copilot helped with that regard. Nevertheless, there's still the not reference found for module model. 🤔

trinhanhngoc commented 1 year ago

While investigating this issue, I discovered an interesting bug in the Odoo plugin. It's interesting to discover bugs that have been around for a long time.

trinhanhngoc commented 1 year ago

Hi @jcfernandez-890825 The new version 2023.6.3 just released with various improvements for this issue.