server-ux
server-ux copied to clipboard
Base tier validation wrongfullt overwrites readonly attribute on readonly fields (when readonly is empty on form)
trafficstars
Module
base_tier_validation
Describe the bug
Forms with tier validation will have readonly fields like computed fields become writeable in the pre review phase. In some cases this can cause indirect errors. I believe this has to do with force_save which is supposed to be off on specific readonly fields, which triggers anyway when reaonly is False.
To Reproduce
Affected versions: 18.0.1.1.0 (Probably all versions, I did not check any others)
Steps to reproduce the behavior:
- Have a computed field with readonly=True (any readonly field will probably do)
- Add it to a form with an empty readonly condition
Expected behavior Just like without a validation module, the readonly attribute should be True instead of bool(review_ids)
Additional context I wrote a fix here https://github.com/OCA/server-ux/pull/1066/files Have a nice day!