Skip to content

[19.0][IMP] res_partner_operating_unit: make operating_unit_ids an editable stored computed field#846

Open
vvrossem wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-imp-res_partner_operating_unit
Open

[19.0][IMP] res_partner_operating_unit: make operating_unit_ids an editable stored computed field#846
vvrossem wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-imp-res_partner_operating_unit

Conversation

@vvrossem
Copy link
Copy Markdown
Contributor

@vvrossem vvrossem commented Apr 22, 2026

operating_unit_ids on res.partner is now an editable stored computed field (readonly=False, store=True) that automatically derives its value from user_ids.assigned_operating_unit_ids for user-linked partners, while remaining freely editable for standalone partners.

This replaces the explicit sync logic in res.users (create/write overrides and _sync_partner_default_operating_unit).

_check_operating_unit_ids rejects direct writes on user-linked partners that diverge from the user's assigned OUs.

@OCA-git-bot OCA-git-bot added mod:res_partner_operating_unit Module res_partner_operating_unit series:19.0 labels Apr 22, 2026
@vvrossem vvrossem force-pushed the 19.0-imp-res_partner_operating_unit branch 3 times, most recently from 5915e68 to 667e3d2 Compare April 23, 2026 10:36
…field

`operating_unit_ids` on `res.partner` is now a stored computed field
(`readonly=False`, `store=True`) that automatically derives its value from
`user_ids.assigned_operating_unit_ids` for user-linked partners, while
remaining freely editable for standalone partners.

This replaces the explicit sync logic in `res.users` (`create`/`write`
overrides and `_sync_partner_default_operating_unit`).

`_check_operating_unit_ids` rejects direct writes on
user-linked partners that diverge from the user's assigned OUs.
@vvrossem vvrossem force-pushed the 19.0-imp-res_partner_operating_unit branch from 667e3d2 to fcc6b35 Compare April 24, 2026 07:08
@vvrossem vvrossem changed the title [19.0][IMP] res_partner_operating_unit: OU consistency between partners & users [19.0][IMP] res_partner_operating_unit: make operating_unit_ids an editable stored computed field Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:res_partner_operating_unit Module res_partner_operating_unit series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants