Skip to content

[15.0] server_environment: replaces existing attrs with only readonly attribute #242

@AungKoKoLin1997

Description

@AungKoKoLin1997

Module

server_environment

Describe the bug

I tried using the webservice module from OCA/web-api, and noticed that the attrs defined for some fields in the view (example here) are being replaced entirely by a readonly attribute set from the _server_env_view_set_readonly method of server_environment.

As a result, any existing attrs like invisible or required are lost.

Image

In later Odoo versions, this issue doesn’t occur because they still rely on _fields_view_get, which is active until Odoo 15. Starting from Odoo 16, _fields_view_get was deprecated, and the _server_env_view_set_readonly method is no longer used when rendering the view — so it doesn't override the attrs anymore.

Image

I'm not sure about the original reasoning for replacing the entire attrs dictionary instead of updating only the readonly part. Perhaps there’s context I’m missing, but this behavior creates conflicts with modules that define additional conditions using attrs.

@qrtl QT5192

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstalePR/Issue without recent activity, it'll be soon closed automatically.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions