Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Purchase (purchase)
• Discuss (mail) • Invoicing (account) |
Community Apps Dependencies | Show |
Lines of code | 566 |
Technical Name |
adevx_product_variant_default_code |
License | OPL-1 |
Website | https://adevx.com |
Versions | 17.0 18.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Purchase (purchase)
• Discuss (mail) • Invoicing (account) |
Community Apps Dependencies | Show |
Lines of code | 566 |
Technical Name |
adevx_product_variant_default_code |
License | OPL-1 |
Website | https://adevx.com |
Versions | 17.0 18.0 |

Module Information's
Overview
-
This module automatically generate Product Reference (default_code) according to attributes data
with a
configurable behavior.
It defines a reference mask on the product templates so the variants references are automatically set. For example:- Product template: Jacket
- Attributes: - Color: White, Black - Size: M, L
- Reference mask: JKT01-[Color]-[Size]
-
Reference on variants:
- JKT01-Wh-M Jacket White M
- JKT01-Bl-M Jacket Black M
- JKT01-Wh-L Jacket White L
- JKT01-Bl-L Jacket Black L
- Inside this module we Generate Default Code Based on Category and check on it Must be unique. and add field in product to make user press it if went to add code manual
Usage
To set the reference mask up on any product template âVariant reference maskâ new field.
When creating a new product template without specifying the Variant reference mask, a default value for Variant reference mask will be automatically generated according to the attribute line settings on the product template (if any). The mask will then be used as an instruction to generate default code of each product variant of the product template with the corresponding Attribute Code (of the attribute value) inserted. Besides the default value, Variant reference mask can be configured to your liking, make sure putting the Attribute Name inside [] marks (it is case sensitive).
Example:
Creating a product named Jacket with two attributes, Size and Color:
Product: Jacket Color: Black(Bl), White(Wh) # Black and White are the attribute values; 'Bl' and 'Wh' are the corresponding codes Size: L (L), XL(XL)
The automatically generated default value for the Variant reference mask will be [Color]-[Size] and so the âdefault codeâ on the variants will be Bl-L, Wh-L, Bl-XL and Wh-XL.
The mask value can be fully customized whatever you like. You can even have the attribute name appear more than once in the mask such as, Jacket/[Size]~[Color]~[Size], and the generated code on variants will be something like Jacket/L~Bl~L (for variant with Color âBlackâ and Size âLâ).
When the code attribute is changed, it automatically regenerates the âdefault codeâ on all variants affected.
Aditionally, a product attribute can be set and so it will be appended to the product default_code. In the first example, setting a Color code to CO would give default_code like this: COBl-L, COWh-L, COBl-XL and COWh-XL.
Avoiding mask in variants
You can avoid this behavior or force a manual default_code on variant. To do so, go to Product Variants > [any variant you want to set up] and set manually its reference code. The field manual code will be set to on and the variant internal reference will no longer be changed by this module.
Unset manual code and the reference code will be unlocked again.
Features
Change Internal Reference Field String to Default Code and required attribute
Screens
Setting

Product Template Form

Product Variant Form

Product Attribute


Product Attribute Value


Our Apps
Acknowledgment
We pleasure team of Product Variant Default Code it's guide us for our enhancement.
Adevx Upgrade and Customized This Module (Version 17)
Support
Got questions or need help? Get in touch.
Say hi to us on WhatsApp!
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module