Repository
OCA/product-pack · module folder · Try on Runboat
Module version
1.1.0
Category
Product
Folder size
0.16 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
VĂ­ctor MartĂ­nez, OCA-git-bot, oca-ci, jpo, mgu, Guido Galetto
Odoo dependencies
odoo/odoo:
- web
- bus
- uom
Python dependencies
None
System dependencies
None
Required by
sale_product_pack, stock_product_pack
Description

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
nan_product_pack_form product.product.pack.form product.product form Inherits product.product_normal_form_view
product_pack_line_form product.pack.line.form product.pack.line form New
product_pack_line_tree product.pack.line.tree product.pack.line list New
product_template_form_view product.template.pack.form product.template form Inherits product.product_template_form_view
product_template_only_form_view product.template.pack.form product.template form Inherits product.product_template_only_form_view
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (4)

New fields (3)
  • parent_product_id Many2one → product.product
    index=True ondelete='cascade' required=True args: 'product.product', 'Parent Product'
  • product_id Many2one → product.product
    index=True ondelete='cascade' required=True args: 'product.product', 'Product'
  • quantity Float
    default=1.0 digits='Product Unit' required=True
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • pack_line_ids One2many → product.pack.line
    help='Products that are part of this pack.' args: 'product.pack.line', 'parent_product_id', 'Pack Products'
  • used_in_pack_line_ids One2many → product.pack.line
    help='Packs where product is used.' args: 'product.pack.line', 'product_id', 'Found in packs'
Public methods (2)
  • get_pack_lines(self)
    Returns the content (lines) of the packs. By default, return all the pack_line_ids, but that function can be overloaded to introduce filtering function by date, etc...
  • split_pack_products(self)

New fields (7)
  • pack_component_price Selection
    help="On sale orders or purchase orders:\n* Detailed per component: Detail lines with prices.\n* Totalized in main product: Detail lines merging lines prices on pack (don't show component prices).\n* Ignored: Use product pack price (ignore detail line prices)." args: [('detailed', 'Detailed per component'), ('totalized', 'Totalized in main product'), ('ignored', 'Ignored')]
  • pack_line_ids One2many
    related='product_variant_ids.pack_line_ids'
  • pack_modifiable Boolean
    help='If you check this field yo will be able to edit sale/purchase order line relate to its component'
  • pack_modifiable_invisible Boolean
    compute='_compute_pack_modifiable_invisible' help='Technical field in order to compute the availability of the Pack Modifiable field'
  • pack_ok Boolean
    help='Is a Product Pack?' args: 'Is Pack?'
  • pack_type Selection
    help='On sale orders or purchase orders:\n* Detailed: Display components individually in the sale order.\n* Non Detailed: Do not display components individually in the sale order.' string='Pack Display Type' args: [('detailed', 'Detailed'), ('non_detailed', 'Non Detailed')]
  • used_in_pack_line_ids One2many
    readonly=True related='product_variant_ids.used_in_pack_line_ids'
Public methods (3)
  • onchange_pack_type(self)
    @api.onchange('pack_type', 'pack_component_price')
  • split_pack_products(self)
    Split products and the pack in 2 separate recordsets. :return: [packs, no_packs]
  • write(self, vals)
    We remove from product.product to avoid error.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…