Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0] Error when try to add field to res.users from UI #91678

Open
wm-cortex opened this issue May 18, 2022 · 0 comments
Open

[15.0] Error when try to add field to res.users from UI #91678

wm-cortex opened this issue May 18, 2022 · 0 comments

Comments

@wm-cortex
Copy link
Contributor

Impacted versions:
15.0

Steps to reproduce:

  1. Enable developer mode.
  2. Go to settings -> Technical-> Database Structure->Models.
  3. Search for res.users and open it.
  4. Try to add a new field.

Once click on the save button, getting the below error:

Unable to order by name: fields used for ordering must be present on the model and stored.

The `name' field in res.users is inherited (not stored) from res.partner and used in res.users order fields and the below code check if the fields used in the order is not stored then raise the error I got.

https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/models/ir_model.py#L231

for field in order_fields:
                if field not in stored_fields:
                    raise ValidationError(_("Unable to order by %s: fields used for ordering must be present on the model and stored.", field))

Note: This issue happened with models copied from other models (Delegation inheritance) and use related field (not stored) in new copied model order for example res.users , product.product

Current behavior:

Can't add a new field to res.users

Expected behavior:

Add ability to add a new field to res.users.

Video/Screenshot link (optional):

Support ticket number submitted via odoo.com/help (optional):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant