website_sale_secondary_unit
Extend Odoo's website shop to let customers buy products using configured secondary units of measure.
Key Features
- product.secondary.unit: Adds website publication controls to secondary unit records so only published units appear to shoppers.
- product.template: Provides an option to disallow selling in the base unit and exposes secondary unit availability to the website variant info.
- sale.order: Propagates the selected secondary unit through cart operations, defaulting to a secondary unit when base unit sales are disabled, and adjusts cart counters accordingly.
- sale.order.line: Computes aligned secondary quantities from the primary unit during line creation and updates, including dependent conversions.
- website_sale: Stores the shopper's secondary unit choice in the session, filters available units to those published, and enriches cart notifications with readable secondary unit labels.
- website.shop: Renders secondary unit selectors and quantity controls on the product page, cart, and checkout while hiding redundant primary quantity widgets when alternatives exist.
- javascript: Keeps secondary and primary quantities synchronized client-side and injects the chosen secondary unit into cart submissions.
- security: Limits portal and public read access to secondary units that are published for the website.
- installation: Initializes existing products with permission to sell in the base unit so catalogs remain consistent on module install.