Skip to content

Conversation

@sergiobstoj
Copy link
Member

  • Volume field was not computed when creating pickings/moves from the UI
  • Root cause: readonly=False on a stored computed field causes the ORM to treat the explicit 0 sent by the web client as a manual override, skipping recompute
  • Removed readonly=False and states from Python field definitions
  • Moved readonly logic to XML views via attrs (editable in draft, readonly in done/cancel)

- Volume field was not computed when creating pickings/moves from the UI
- Root cause: `readonly=False` on a stored computed field causes the ORM to treat
    the explicit `0` sent by the web client as a manual override, skipping recompute
- Removed `readonly=False` and `states` from Python field definitions
- Moved readonly logic to XML views via `attrs` (editable in draft, readonly in done/cancel)
@OCA-git-bot
Copy link
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@alvaro-gmz
Copy link

LGTM

@sergiobstoj sergiobstoj marked this pull request as ready for review February 9, 2026 11:17

volume = fields.Float(
compute="_compute_volume",
readonly=False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should remain readonly=False also on the python side otherwise it's no more possible to manually assign a value.

Copy link
Contributor

@lmignon lmignon Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the fix to the problem would be to simply declare the field as precompute=True 🤔

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

Successfully merging this pull request may close these issues.

5 participants