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

base_tier_validation: Missing field "need_validation" in form-embedded lists #825

Open
houzefa-abba opened this issue Feb 14, 2024 · 2 comments · May be fixed by #846
Open

base_tier_validation: Missing field "need_validation" in form-embedded lists #825

houzefa-abba opened this issue Feb 14, 2024 · 2 comments · May be fixed by #846
Labels

Comments

@houzefa-abba
Copy link
Member

Hi here is an issue when a model plugged to base_tier_validation is displayed as a list in another form: when clicking a record in such a list, the view crashes:

Error: Missing field string information for the field 'need_validation' from the 'res.partner' model

An easy way to test this is from a partner-contact runboat:

  • open contacts, switch to list view
  • select 2 contacts > Action > Merge (standard Odoo feature)
  • in the merge wizard, click on a partner

➔ Screenshot:
Screenshot at 2024-02-14 17-39-21

This isn't specific to that model nor to that wizard; I can also reproduce from a sale-workflow runboat in a more convoluted way:

  • create a quotation, sell a product tracked via serial number (eg "Drawer")
  • open that serial number (lot) form within Inventory
  • edit view to remove invisibility condition on the sale_order_ids field
  • click on a sales order

➔ Screenshot:
Screenshot at 2024-02-14 17-40-19

@tugsbayarg
Copy link

You have to add need_validation field with invisiblity=1 in form view. To add field into view you need to inherit main form view and add field into inherited form view

@houzefa-abba
Copy link
Member Author

You have to add need_validation field with invisiblity=1 in form view. To add field into view you need to inherit main form view and add field into inherited form view

Hi that indeed seems to be what's missing; the issue here is base_tier_validation users never added that so far (eg in sale_tier_validation).

Adding it by hand in each derived module seems cumbersome to me; especially when talking about modals such as that partner merge one which may well define their own views.

I think the assumption so far was that the mixin provided by base_tier_validation would inject these fields, same as it already injects some UI elements such as validation buttons.

houzefa-abba added a commit to xcgd/server-ux that referenced this issue Mar 15, 2024
Previous implementation was losing fields in some cases; new one
properly merges dicts/tuples.

This fixes odd "Missing field string information" errors in
form-embedded lists.

This cset also removes an obsolete `base_model_name` context key no
longer used in Odoo 16.

This cset adds a `test_get_view` test which checks for that
`need_validation` field; it was failing with the previous impl.

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

Successfully merging a pull request may close this issue.

2 participants