server-ux icon indicating copy to clipboard operation
server-ux copied to clipboard

Base tier validation wrongfullt overwrites readonly attribute on readonly fields (when readonly is empty on form)

Open EmileNoppeSomko opened this issue 7 months ago • 1 comments
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:

  1. Have a computed field with readonly=True (any readonly field will probably do)
  2. 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!

EmileNoppeSomko avatar Apr 17 '25 10:04 EmileNoppeSomko