Repository
OCA/product-attribute · module folder · Try on Runboat
Module version
1.0.0
Category
Product
Folder size
0.21 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/product-attribute
Last tracking update
2026-08-19 17:41:07
Authors
Odoo Community Association (OCA), Zikzakmedia SL, Sodexis
Maintainers
Odoo Community Association (OCA), Zikzakmedia SL, Sodexis
Committers
OCA-git-bot, oca-ci, bosd
Odoo dependencies
odoo/odoo:
- web
- bus
- uom
Python dependencies
None
System dependencies
None
Required by
None
Description
This module allows to associate a sequence to the product reference. The
reference (default code) is unique (SQL constraint) and required.

You can optionally specify different sequences for different product
categories.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
product_category_form_view product.category.form - product_sequence product.category form Inherits product.product_category_form_view
res_config_settings_view_form res.config.settings.view.form.inherit.product res.config.settings form Inherits product.res_config_settings_view_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (6)

New fields (0)

No new fields.

Public methods (1)
  • get_category_sequence_id(self, category=False)
    @api.model

New fields (2)
  • code_prefix Char
    help='Prefix used to generate the internal reference for products created with this category. If blank the default sequence will be used.' string='Prefix for Product Internal Reference'
  • sequence_id Many2one → ir.sequence
    comodel_name='ir.sequence' copy=False help='This field contains the information related to the numbering of the journal entries of this journal.' readonly=True string='Product Sequence'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • write(self, vals)

New fields (1)
  • default_code Char
    default='/' help="Set to '/' and save if you want a new internal reference to be proposed." tracking=True
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • write(self, vals)
    To assign a new internal reference, just write '/' on the field. Note this is up to the user, if the product category is changed, she/he will need to write '/' on the internal reference to force the re-assignment.

New fields (0)

No new fields.

Public methods (1)
  • copy(self, default=None)
    Let an explicitly given internal reference reach the new variant. Odoo restores a ``default_code`` passed in ``default`` at the end of ``create()``, but only as long as the new template does not have one yet. As this module gives every new variant a number from the sequence, that is never the case and the given reference would be dropped. So hand it over to ``_prepare_variant_values()`` instead, which also avoids drawing a sequence number that nothing would ever use.

New fields (1)
  • use_parent_categories_to_determine_prefix Boolean
    help='Use parent categories to determine the prefix if the category has no settings for the prefix.' string='Use parent categories to determine the prefix'
Public methods (0)

No public methods.

New fields (1)
  • use_parent_categories_to_determine_prefix Boolean
    readonly=False related='company_id.use_parent_categories_to_determine_prefix'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…