Skip to content

[FIX] account_operating_unit: use sudo() in OU onchange#835

Open
IJOL wants to merge 1 commit intoOCA:18.0from
BITVAX:18.0-fix-journal-access-denied
Open

[FIX] account_operating_unit: use sudo() in OU onchange#835
IJOL wants to merge 1 commit intoOCA:18.0from
BITVAX:18.0-fix-journal-access-denied

Conversation

@IJOL
Copy link
Copy Markdown

@IJOL IJOL commented Apr 5, 2026

Summary

  • Add .sudo() when reading journal_id.operating_unit_id and journal_id.type in _onchange_operating_unit to prevent AccessError for users without journal read permission.

Test plan

  • Create a user with OU Manager group but without Accounting Manager group
  • Open a vendor bill and change the operating unit
  • Verify no AccessError is raised when the journal onchange triggers

Users without journal read permission get AccessError when the
_onchange_operating_unit triggers. Use sudo() to safely read
journal.operating_unit_id and journal.type.

Port of BITVAX fix from 16.0-fix-journal-access-denied branch.
@AaronHForgeFlow
Copy link
Copy Markdown
Contributor

can you explain how to reproduce the issue?

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.

2 participants