Module
account_operating_unit
Describe the bug
When registering a payment from the invoice form, the payment wizard (account.payment.register) does not filter available journals by the invoice's operating unit.
Steps to reproduce
- Configure two operating units (OU_A, OU_B) with separate bank/cash journals
- Create a user with access to only OU_B
- Create and post a vendor bill assigned to OU_B
- Click Register Payment on the bill
Current behavior
-
The journal dropdown shows journals from all OUs (including OU_A)
-
The default journal may be from OU_A
-
Clicking "Create Payment" raises AccessError:
COMPANY (id=X) does not have 'read' access to: Journal (account.journal)
Because the ir.rule "Journals from allowed operating units" blocks access to OU_A journals for the OU_B user.
Expected behavior
- Only journals matching the invoice's OU (or with no OU) should appear in the dropdown
- The default journal should be from the invoice's OU
- Payment creation should succeed without AccessError
Root cause
account.payment.register._get_batch_available_journals() (core Odoo) searches journals filtered by company and type, but account_operating_unit does not extend this method to add OU filtering. The ir.rule filters by the user's OUs, but when a user has access to multiple OUs, journals from all their OUs appear — even when paying an invoice from a specific OU.
Affected versions
- 18.0 (confirmed)
- Likely affects 16.0 and 17.0 as well
Module
account_operating_unitDescribe the bug
When registering a payment from the invoice form, the payment wizard (
account.payment.register) does not filter available journals by the invoice's operating unit.Steps to reproduce
Current behavior
The journal dropdown shows journals from all OUs (including OU_A)
The default journal may be from OU_A
Clicking "Create Payment" raises
AccessError:Because the ir.rule "Journals from allowed operating units" blocks access to OU_A journals for the OU_B user.
Expected behavior
Root cause
account.payment.register._get_batch_available_journals()(core Odoo) searches journals filtered by company and type, butaccount_operating_unitdoes not extend this method to add OU filtering. The ir.rule filters by the user's OUs, but when a user has access to multiple OUs, journals from all their OUs appear — even when paying an invoice from a specific OU.Affected versions