product_barcode_required
Enforces barcode requirement for non-service products by defaulting it to the internal reference when a company setting is enabled.
Key Features
- res.config.settings: Adds a company-level option to require barcodes on product variants via the general products settings.
- res.company: Stores whether the barcode requirement for product variants is active for the company.
- product.product: Enforces barcode presence on create and update with validation, auto-filling it from the internal reference when required, and marks the field required in product variant forms.
- product.template: Bypasses variant-level barcode checks on template operations and avoids requiring barcodes when a template has multiple variants.
- product.barcode.required.mixin: Determines when barcodes are required by checking the company flag and product type, populates the barcode from the internal reference on change, and raises a validation error listing products missing barcodes.