operating_unit
Defines operating units as organizational subdivisions with user access controls and hooks for multi-unit management across a company.
Key Features
- operating.unit: Defines operating unit records with code, name, partner, company binding, unique-per-company constraints, and display names prefixed by the code.
- operating.unit: Links the creator as an allowed user on new operating units and refreshes the registry cache after changes to keep security domains in sync.
- res.users: Adds assigned operating units, computed allowed operating units, and a default operating unit constrained to the user’s accessible companies.
- res.users: Derives default operating units for new users from the default user template when default rights provisioning is enabled.
- res.users: Clears the default operating unit when it is no longer in the allowed set and exposes a helper to retrieve the current user’s operating units.
- security: Provides multi operating unit and manager groups with corresponding access rights to control read and CRUD permissions on operating units.
- security: Adds record rules limiting operating unit visibility to current companies and to units explicitly assigned to the user.
- ir.rule: Injects the current user’s allowed and default operating unit ids into rule evaluation contexts for reuse by dependent modules.
- ui: Offers tree, form, and search views plus a menu to manage operating units, and embeds operating unit selection widgets on the user form.