Repository
OCA/product-pack · module folder · Try on Runboat
Module version
1.0.2
Category
Sales
Folder size
0.1 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/product-pack
Last tracking update
2026-08-07 09:06:27
Authors
Odoo Community Association (OCA), ADHOC SA, NaN·tic, Tecnativa
Maintainers
Odoo Community Association (OCA), ADHOC SA, NaN·tic, Tecnativa
Committers
Maxime Franco, Matias Peralta, Franco Leyes, OCA-git-bot, oca-ci, mgu
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
sale_stock_product_pack
Description
This module adds *Product Pack* functionality to sales orders. You can
choose a *Pack* in *sales order lines* and see different behaviors
depending on "Pack type" and "Pack component price" fields options
selected on this *Pack*.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
product_pack_line_form product.pack.line.sale.form product.pack.line form Inherits product_pack.product_pack_line_form
product_pack_line_tree product.pack.line.sale.tree product.pack.line tree Inherits product_pack.product_pack_line_tree
view_order_form sale.order form Inherits sale.view_order_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (3)

New fields (1)
  • sale_discount Float
    digits='Discount' args: 'Sale discount (%)'
Public methods (1)
  • get_sale_order_line_vals(self, line, order)

New fields (0)

No new fields.

Public methods (2)
  • check_pack_line_unlink(self)
    @api.onchange('order_line')
    At least on embeded tree editable view odoo returns a recordset on _origin.order_line only when lines are unlinked and this is exactly what we need
  • write(self, vals)

New fields (7)
  • do_no_expand_pack_lines Boolean
    compute='_compute_do_no_expand_pack_lines' help='This is a technical field in order to check if pack lines has to be expanded'
  • pack_child_line_ids One2many → sale.order.line
    args: 'sale.order.line', 'pack_parent_line_id', 'Lines in pack'
  • pack_component_price Selection
    related='product_id.pack_component_price'
  • pack_depth Integer
    help='Depth of the product if it is part of a pack.' args: 'Depth'
  • pack_modifiable Boolean
    help='The parent pack is modifiable'
  • pack_parent_line_id Many2one → sale.order.line
    help='The pack that contains this product.' index=True args: 'sale.order.line', 'Pack'
  • pack_type Selection
    related='product_id.pack_type'
Public methods (5)
  • action_open_parent_pack_product_view(self)
  • check_pack_line_modify(self)
    @api.onchange('product_id', 'product_uom_qty', 'product_uom_id', 'price_unit', 'discount', 'name', 'tax_ids')
    Do not let to edit a sale order line if this one belongs to pack
  • create(self, vals_list)
    @api.model_create_multi
    Only when strictly necessary (a product is a pack) will be created line by line, this is necessary to maintain the correct order.
  • expand_pack_line(self, write=False)
  • write(self, vals)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…