TIP: You can type at any time to perform a new search.
Product Sequence
product_sequence · OCA/product-attribute
🛠 Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE product_product SET default_code = '!!mig!!' || id WHERE default_code IS NULL OR default_code = '/';` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Found by automated static analysis: patterns worth a look before/after upgrading this module to a newer Odoo version.
- 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
- 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 ID | Name | Model | Type | Status |
|---|---|---|---|---|
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_prefixCharhelp='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_idMany2one → ir.sequencecomodel_name='ir.sequence'copy=Falsehelp='This field contains the information related to the numbering of the journal entries of this journal.'readonly=Truestring='Product Sequence'
-
create(self, vals_list)@api.model_create_multi -
write(self, vals)
New fields (1)
-
default_codeChardefault='/'help="Set to '/' and save if you want a new internal reference to be proposed."tracking=True
-
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_prefixBooleanhelp='Use parent categories to determine the prefix if the category has no settings for the prefix.'string='Use parent categories to determine the prefix'
No public methods.
New fields (1)
-
use_parent_categories_to_determine_prefixBooleanreadonly=Falserelated='company_id.use_parent_categories_to_determine_prefix'
No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…