purchase_product_pack
Enable purchasing of product packs by expanding pack items on purchase orders with correct component lines and pricing.
Key Features
- purchase.order.line: Adds pack linkage fields (parent, children, depth, modifiable flag) and a computed flag to decide whether to expand pack lines during price updates.
- purchase.order.line: Automatically expands detailed pack products into component purchase lines on create/update, reusing existing child lines when applicable.
- purchase.order.line: Prevents editing of non-modifiable pack component lines and provides an action to open the parent pack product.
- purchase.order.line: Recomputes unit price for pack items from component costs using seller pricing with tax, currency, and UoM adjustments.
- product.pack.line: Generates purchase line values for pack components with proper quantities, names, parent linkage, and zero pricing when pack price type is totalized or ignored.
- product.pack.line: Computes component cost from vendor price lists or standard cost for use in pack pricing.
- product.product: Calculates pack cost as the sum of component seller costs to feed purchase price computation.
- purchase.order: Omits child pack lines when duplicating orders so pack parents re-expand in the copy.
- purchase.order: Blocks deletion of pack component lines when the pack is not modifiable and cascades removal of subordinate pack lines when a parent is deleted.