odoo-ide / vscode-odoo

Visual Studio Code extension for Odoo
https://marketplace.visualstudio.com/items?itemName=trinhanhngoc.vscode-odoo
46 stars 3 forks source link

VS Code choose Odoo Version? #8

Closed raphaelritter-2bit closed 1 year ago

raphaelritter-2bit commented 1 year ago

We are using your plugin for flectra (shouldn't matter except a few things) and in code-server. For me it is unclear how we can say the odoo version etc. because we are getting a lot of errors like not iteratable etc. even so it is.

What do you suggest and is there a easy way to make it completely work for flectra (in the end it is just replacing odoo with flectra keyword)? Thanks in advance for your help :)

trinhanhngoc commented 1 year ago

Hi @raphaelritter-2bit , the PyCharm plugin for Odoo has good support for Flectra 2. However, the VSCode extension for Odoo is currently in early development and does not support Flectra yet. I will add Flectra support in a future version of the extension.

trinhanhngoc commented 1 year ago

We are using your plugin for flectra (shouldn't matter except a few things) and in code-server. For me it is unclear how we can say the odoo version etc. because we are getting a lot of errors like not iteratable etc. even so it is.

What do you suggest and is there a easy way to make it completely work for flectra (in the end it is just replacing odoo with flectra keyword)? Thanks in advance for your help :)

Anyway, can you provide screenshots of the errors you are getting?

raphaelritter-2bit commented 1 year ago

@trinhanhngoc thanks for the fast response and regarding flectra support i'm fully aware. As soon as i activate the extension i get a lot of messages like this: image Even in OCA modules etc. I think it is not detecting the proper odoo version which lies below (odoo14 / Flectra 2) or am I seeing this wrong?

trinhanhngoc commented 1 year ago

@raphaelritter-2bit Looks like you are facing the same problem in #7 . I guess your workspace structure is the cause. Can you share with me your workspace structure so I can reproduce the error myself?

raphaelritter-2bit commented 1 year ago

@trinhanhngoc well we start everything from our git repo, meaning flectra resources can't be found there only our addons. Does that mean the plugin only works with we would copy our addons into addons folder of flectra code and open code-server on that level?

trinhanhngoc commented 1 year ago

@raphaelritter-2bit No, you don't need to copy anything. But you need to tell VSCode about the location of flectra source code. Otherwise, VSCode can not resolve the class flectra.models.Model and you will get errors like you said.

You can follow this guide to add the flectra source code as another workspace root besides your addons: https://github.com/odoo-ide/vscode-odoo/issues/7#issuecomment-1455401738.

Also see: https://code.visualstudio.com/docs/editor/multi-root-workspaces