product_cost_security
Restricts product cost visibility and editing through dedicated security groups and enforced checks on product models.
Key Features
- security: Adds a Product costs security category with read and edit groups to control who can view or change cost prices.
- product.cost.security.mixin: Provides a mixin that detects cost-protected fields, prevents writes by users without edit rights, and forces them readonly in metadata.
- product.cost.security.mixin: Computes a user_can_update_cost flag so views can show or disable cost fields based on permissions.
- product.template: Protects the standard price field with the cost reader group and inherits the mixin to enforce edit permissions.
- product.product: Protects the product variant cost field with the cost reader group and inherits the mixin to enforce edit permissions.
- product.template view: Hides the cost section of the product form unless the user belongs to the cost reader group.