odoo-ide / vscode-odoo

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

Keep original function signature when overriding model methods #38

Closed trinhanhngoc closed 8 months ago

trinhanhngoc commented 8 months ago

Hello @trinhanhngoc,

I'm not entirely sure if this is the appropriate place for me to add my comment or create a new issue, but it seems to be related to the issue I've come across here, so I'll go ahead and post my comment in this issue.

I've been using PyCharm with the Odoo IDE plugin, and I'm currently experimenting with VSCode along with the Odoo IDE. I've noticed a difference in behavior when I attempt to inherit a class method. Specifically, when I start typing, there's an autocomplete feature for the function name. However, when I accept this autocomplete suggestion, the inherited method includes parameter names within its definition.

image

image

I'm curious whether this behavior is intentional or if there's a way to disable it, allowing the parameter names to appear as they typically do in PyCharm.

Current Behavior:

def search_read(self, domain: list | None = ..., fields: list[str] | None = ..., offset: int = ..., limit: int | None = ..., order: str | None = ..., **read_kwargs: str) -> list[dict[str, Any]]:
    return super().search_read(domain, fields, offset, limit, order, **read_kwargs)

Expected Behavior:

def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None, **read_kwargs):
    return super().search_read(domain, fields, offset, limit, order, **read_kwargs)

VSCode version: 1.83.1 Odoo IDE version: v0.11.1

Your insights and guidance on resolving this issue would be greatly appreciated. Thank you!

Originally posted by @gustitammam in https://github.com/odoo-ide/vscode-odoo/issues/23#issuecomment-1780089459

trinhanhngoc commented 8 months ago

Hello @gustitammam ,

The new version 0.11.2 has been released to address this problem. Thank you for reporting!

gustitammam commented 8 months ago

Hi @trinhanhngoc,

Version 0.11.2 fixed the issue. Thanks for the update!

image