Search 1.9 billion lines of Odoo code on GitHub

product_variant_default_code

Author: AvancOSC,Shine IT,Tecnativa,Odoo Community Association (OCA)
License: AGPL-3
Branch: patch-1
Repository: zeroheure/product-variant
Dependencies: base_setup, and product
Languages: PO File (1443, 71.3%), Python (341, 16.9%), XML (143, 7.1%), and reStructuredText (96, 4.7%)
Other branches: 10.0, 11.0, patch-2, patch-3, and patch-4
Other repositories: 394879024/odoomrp-wip, AgoraDev/odoomrp-wip, Alfa-90/product-variant, Antiun/odoomrp-wip, Callino/product-variant, Change2improve/product-variant, ClearCorp/odoomrp-wip, Comunitea/product-variant, Daniel-CA/product-variant, DarkGreising/odoomrp-wip, Dayssam/odoomrp-wip, Diego88cc/odoomrp-wip, Digital5-Odoo/odoomrp-wip, Dobtor-OCA/product-variant, ERPLibre/product-variant, ElvenStudio/odoomrp-wip, Endika/odoomrp-wip, FelixAdler/odoomrp-wip, ForgeFlow/odoomrp-wip, ForgeFlow/product-variant, GGamblin/odoomrp-wip, Gabinete-Digital/product-variant, GiacoJona/product-variant, Gofekra/product-variant, GrupoAlvamex/odoomrp-wip, GrupoAlvamex/product-variant, Guobower/product-variant, HaojunZou/odoomrp-wip, IJOL/odoomrp-wip, InakiZabala/odoomrp-wip, InfotoolsCorp/odoomrp-wip, Ingeos/odoomrp-wip, Ingeos/product-variant, Innovahn/odoomrp-wip, JavierMarhuenda/odoomrp-wip, JuaniFreedoo/odoomrp-wip, KennyLeung/odoomrp-wip, LudLaf/odoomrp-wip, MadsackMediaStore/odoomrp-wip, Martronic-SA/product-variant, MathBenTech/product-variant, MedMehdiMMM/odoomrp-wip, MindAndGo/odoomrp-wip, MrZ-777/odoomrp-wip, NeatNerdPrime/product-variant, OCA-MUK/product-variant, OCA/product-variant, OdooBulgaria/odoomrp-wip, OpenPymeMx/odoomrp-wip, OpusVL/product-variant, PESOL/product-variant, PlanetaTIC/product-variant, QANSEE/odoomrp-wip, SalahAdDin/product-variant, SanteLibre/product-variant, Sarfarazsajjad/odoomrp-wip, SetRac/odoomrp-wip, SeuMarco/odoomrp-wip, SeuMarco/product-variant, SimoRubi/product-variant, SimoneVagile/product-variant, Sjd-Risca/odoomrp-wip, StefanRijnhart/odoomrp-wip, Studio73/product-variant, TRESCLOUD/product-variant, Tecnativa/product-variant, Trust-Code/odoomrp-wip, Vauxoo/odoomrp-wip, Vauxoo/product-variant, VbossEkat/odoomrp-wip, VisiionSoluciones/odoomrp-wip, VisiionSolucionesTecnologicas/product-variant, Yakulu/product-variant, YogendrasinhChavda/odoomrp-wip, aaltinisik/odoomrp-wip, aaltinisik/product-variant, abdo3247/odoomrp-wip, acsone/product-variant, aduijs/odoomrp-wip, agaldona/odoomrp-wip-1, akretion/odoomrp-wip, akretion/product-variant, alangwansui/odoomrp-wip, alexteodor/odoomrp-wip, alfredoavanzosc/odoomrp-wip-1, alhashash/odoomrp-wip, alonesword/odoomrp-wip, alpseber/odoomrp-wip, amarildogolloshi/odoomrp-wip, andhit-r/odoomrp-wip, anndream/odoomrp-wip, annieclone/odoomrp-wip, anodino-dev/odoomrp-wip, apetbiz/product-variant, arasty/odoomrp-wip, archetipo/odoomrp-wip, arnaulorente/odoomrp-wip, asphaltzipper/odoomrp-wip, augustodinizl/product-variant, aurestic/odoomrp-wip, aurestic/product-variant, bealdav/product-variant, binovo/odoomrp-wip, bishalgit/product-variant, bisnesmart/odoomrp-wip, bitodoo/product-variant, brain-tec/product-variant, bunhin/odoomrp-wip, camptocamp/product-variant, carlosap92/odoomrp-wip, ccdos/odoomrp-wip, ceteca/odoomrp-wip, chajmill/odoomrp-wip, chenjingxiong/odoomrp-wip, chenrobotcat/odoomrp-wip, chenyingkun/odoomrp-wip, cialuo/odoomrp-wip, codequarters/odoomrp-wip, codewr/odoomrp-wip, colima/odoomrp-wip, colmeirin/odoomrp-wip, contactek/odoomrp-wip, coopiteasy/product-variant, copermine/odoomrp-wip, cshardey/odoomrp-wip, cubells/odoomrp-wip, cubells/product-variant, cvinh/odoomrp-wip, damdam-s/odoomrp-wip, damendieta/odoomrp-wip, danielkurman/odoomrp-wip, danztensai/odoomrp-wip, daramousk/odoomrp-wip, ddico/odoomrp-wip, dhp-denero/odoomrp-wip, diagramsoftware/odoomrp-wip, diggy128/odoomrp-wip, diggy128/product-variant, digitalwow/odoomrp-wip, diogocduarte/odoomrp-wip, disna-sistemas/odoomrp-wip, dong-z/product-variant, drl9319/odoomrp-wip, druidoo-dev/product-variant, duanyp1991/odoomrp-wip, dvitme/odoomrp-wip, eLBati/product-variant, eezee-it/odoomrp-wip, emendez2006/odoomrp-wip, enmingc/odoomrp-wip, ernestotejeda/product-variant, erocre/odoomrp-wip, esthermm/odoomrp-wip, ethernetcash/odoomrp-wip, exosoftware/oca-product-variant, factorlibre/odoomrp-wip, factorlibre/product-variant, farfansixto/odoomrp-wip, fedexin40/odoomrp-wip, fevxie/odoomrp-wip, forvas/odoomrp-wip, frankchongli/odoomrp-wip, garzadekoster/odoomrp-wip, george-taotaome/odoomrp-wip, gkliska/odoomrp-wip, gleke/odoomrp-wip, globalyst/odoomrp-wip, gmoncada/odoomrp-wip, grindtildeath/product-variant, grottas/odoomrp-wip, gsunjka/odoomrp-wip, gurneyalex/product-variant, haryoran04/odoomrp-wip, hassanfadl/odoomrp-wip, hifans/odoomrp-wip, hifly/odoomrp-wip, hinfo506/product-variant, hotkee/odoomrp-wip, iamyeonhan/odoomrp-wip, iaranburu/odoomrp-wip, idealisconsultingbe/product-variant, igallart/odoomrp-wip, igallart/product-variant, igorabpereira/odoomrp-wip, initOS/odoomrp-wip, itmeca/odoomrp-wip, izzihector/product-variant, jackethu/odoomrp-wip, jamotion/product-variant, jason156/odoomrp-wip, javieralmancevo/odoomrp-wip, jcarlosmontoya/odoomrp-wip, jellyhappy/odoomrp-wip, jhoengels/odoomrp-wip, jlaloux/product-variant, johannbelet/odoomrp-wip, jorsea/odoomrp-wip, jparssi/odoomrp-wip, juanfe/odoomrp-wip, jusdng/odoomrp-wip, kholioeg/odoomrp-wip, kkarolis/odoomrp-wip, kkoci/odoomrp-wip, kmee/product-variant, konsoar/odoomrp-wip, kos94ok-3D/product-variant, kossovo/odoomrp-wip, lbelorgey/odoomrp-wip, leangjia/odoomrp-wip, lepistone/odoomrp-wip, levkar/odoomrp-wip, lideritjnma/product-variant, lihaihe/odoomrp-wip, likaiyuan/odoomrp-wip, ljsalvatierra-binovo/odoomrp-wip, maljac/odoomrp-wip, marcel1981/odoomrp-wip, marcelomora/odoomrp-wip, marionumza/odoomrp-wip, mathi123/odoomrp-wip, mauroanelli2017/odoomrp-wip, maxhome1/odoomrp-wip, mayang1178/odoomrp-wip, michaeljohn32/odoomrp-wip, mikelarre/odoomrp-wip-1, mikelarre/product-variant, mohshedid/odoomrp-wip, mohzein/odoomrp-wip, molandtoxx/odoomrp-wip, morgana68/odoomrp-wip, msteinfeld-intero/odoomrp-wip, muguli22/odoomrp-wip, mutita/odoomrp-wip, myodoo/odoomrp-wip, niulinlnc/odoomrp-wip, numerigraphe/odoomrp-wip, odoo-modules/odoomrp-wip, odoobgorg/odoomrp-wip, odoocn/odoomrp-wip, odoomrp/odoomrp-wip, oihane/odoomrp-wip, one2pret/odoomrp-wip, onurugur/odoomrp-wip, onurugur/product-variant, open-synergy/odoomrp-wip, oscars8a/product-variant, osstw/odoomrp-wip, ozono/odoomrp-wip, p-tombez/product-variant, parchanco/odoomrp-wip, pedrobaeza/odoomrp-wip, petypi/odoomrp-wip, presenceverte/product-variant, prisehub/odoomrp-wip, pscloud/product-variant, pythoner-3k/odoomrp-wip, qtheuret/product-variant, r3ap3r2004/odoomrp-wip, raycarnes/odoomrp-wip, rchavik/product-variant, rdeheele/odoomrp-wip, richard-willdooit/odoomrp-wip, rlizana/odoomrp-wip, rosenvladimirov/product-variant, rossasa/odoomrp-wip, rsullivan2704/product-variant, s2d4theworld/odoomrp-wip, sagar-developer-92/odoomrp-wip, saigonsofttech/odoomrp-wip, samsagaz/product-variant, samuel1971/odoomrp-wip, sanube/product-variant, sasakuma/odoomrp-wip, sergiocorato/odoomrp-wip, sergiocorato/product-variant, shine-it/odoomrp-wip, simoneversienti/product-variant, slevenhagen/odoomrp-wip, spoerp/product-variant, subteno-it/odoomrp-wip, sum1201/product-variant, supuy-ruby/odoomrp-wip, syci/odoomrp-wip, tegin/product-variant, thaiodoo/odoomrp-wip, thinkopensolutions/odoomrp-odoomrp-wip, time-table/odoomrp-wip, topecz/odoomrp-wip, treytux/odoomrp-wip, tvtma/odoomrp-wip, ubic135/odoomrp-wip, vafonso/odoomrp-wip, valenciaricardos/odoomrp-wip, valley51/odoomrp-wip, valmarnet/product-variant, versada/odoomrp-wip, vrms/odoomrp-wip, vsanjuan2/odoomrp-wip, wahhid/odoomrp-wip, wanfgh/odoomrp-wip, waynejid/odoomrp-wip, westlyou/odoomrp-wip, willmakenoise/product-variant, windedge/odoomrp-wip, x0rzkov/odoo-product-variant, xiaowenzi/odoomrp-wip, xpansa/odoomrp-wip, yahooboohooyah/odoomrp-wip, yasmanycastillo/odoomrp-wip, yastri/odoomrp-wip, yoozeer/odoomrp-wip, yustas147/odoomrp-wip, zbik2607/odoomrp-wip, zhaohuaw/odoomrp-wip, zhuyangbin/product-variant, and zmakrelouf/odoomrp-wip

<a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.svg"> </a> <a name="product-variant-default-code"></a> <h2>Product Variant Default Code</h2> <p>This module automatically generate <em>Internal Reference</em> (<cite>default_code</cite>) according to attributes, with a configurable behavior.</p> <p>It defines a reference mask on the product templates, based on some attributes code you set before. Then variants internal references are automatically set. For example:</p> <p>Creating a product named &quot;Jacket&quot; with two attributes, <em>Size</em> and <em>Color</em>:</p> <pre> <code>Product: Jacket Color: Black(Bl), White(Wh) # Black and White are the attribute values # 'Bl' and 'Wh' are the corresponding codes Size: M (M), L (L)</code> </pre> <p>The automatically generated variant reference mask will be <cite>[Color]-[Size]</cite> and so the <em>Internal Reference</em> on the variants will contain:</p> <pre> <code>'Bl-M', 'Wh-M', 'Bl-L' and 'Wh-L'.</code> </pre> <a name="configuration"></a> <h3>Configuration</h3> <p>Of course, activate <em>Attributes and Variants</em> under <strong>Sales / Product Catalogue</strong> settings (or <strong>Inventory / Products</strong>).</p> <p>Fill <em>Attributes Value Code</em> to each attribute's value.</p> <a name="usage"></a> <h3>Usage</h3> <p>When creating a new product template, once you have added attributes and values, fill the new <em>Reference Prefix</em> field that appear under <em>Internal Reference</em>.</p> <p>A default value for <em>Variant reference mask</em> will be automatically generated according to the attribute line settings on the product template. This mask will then be used as an instruction to generate <em>Internal Reference</em> of each product variant with the corresponding <em>Attribute Value Code</em> inserted. For example:</p> <pre> <code>- Product template: Jacket - Reference prefix: JKT - Attributes: - Color: Black, White, - Size: M, L - Reference mask: `JKT01-[Color]-[Size]` - Variants Internal Reference: - 'JKT01-Bl-M' - 'JKT01-Wh-M' - 'JKT01-Bl-L' - 'JKT01-Wh-L'</code> </pre> <p>Additionally, an <em>Attribute Code</em> can be set. It will be appended to the variant <em>Internal Reference</em>. In the first example, setting a 'Color' code to &quot;CO&quot; would give <em>Internal Reference</em> (<cite>default_code</cite>) like this:</p> <pre> <code>'JKT01-COBl-M', 'JKT01-COWh-M', 'JKT01-COBl-L' and 'JKT01-COWh-L'.</code> </pre> <p>When an attribute or value code is changed, the reference on all variants affected is regenerated.</p> <a name="advanced"></a> <h3>Advanced</h3> <p>To manualy define the reference mask on each product, switch <em>Product Default Code</em> behaviour to &quot;Manual Mask&quot; in <strong>General Settings</strong>. Then, fill the &quot;Variant Reference Mask&quot; field on any product template.</p> <p>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, <cite>Jacket/[Size]~[Color]~[Size]</cite>, and the generated code on variants will be something like 'Jacket/L~Wh~L' (for variant with Color &quot;White&quot; and Size &quot;L&quot;).</p> <p><strong>Note:</strong> In mask value, make sure putting the <em>Attribute Name</em> inside <cite>[ ]</cite> marks (it is case sensitive) and of course, make sure characters &quot;[,]&quot; do not appear in your attribute's name.</p> <a name="avoiding-mask-in-variants"></a> <h4>Avoiding mask in variants</h4> <p>You can avoid this behavior or force a manual reference on variant. To do so, go to <strong>Product Variants &gt; [any variant you want to set up]</strong> and set manually its reference code. The field <em>Manual Reference</em> (<cite>manual_code</cite>) will be set to on and the variant internal reference will no longer be changed by this module.</p> <p>Unset <em>Manual Reference</em> on a variant and the reference code will be unlocked again.</p> <a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/137/10.0"><img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" /></a> <a name="known-issues-roadmap"></a> <h3>Known issues / Roadmap</h3> <p>In case of attribute name update, related mask are not updated.</p> <a name="bug-tracker"></a> <h3>Bug Tracker</h3> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product_variant/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback.</p> <a name="credits"></a> <h3>Credits</h3> <a name="images"></a> <h4>Images</h4> <ul class="simple"> <li>Odoo Community Association: <a class="reference external" href="https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg">Icon</a>.</li> </ul> <a name="contributors"></a> <h4>Contributors</h4> <ul class="simple"> <li>Alfredo de la Fuente &lt;<a class="reference external" href="mailto:alfredodelafuente&#64;avanzosc.es">alfredodelafuente&#64;avanzosc.es</a>&gt;</li> <li>Pedro M. Baeza &lt;<a class="reference external" href="mailto:pedro.baeza&#64;tecnativa.com">pedro.baeza&#64;tecnativa.com</a>&gt;</li> <li>Tony Gu &lt;<a class="reference external" href="mailto:tony&#64;openerp.cn">tony&#64;openerp.cn</a>&gt;</li> <li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li> <li>David Beal &lt;<a class="reference external" href="mailto:david.beal&#64;akretion.com">david.beal&#64;akretion.com</a>&gt;</li> <li>Daniel Campos &lt;<a class="reference external" href="mailto:danielcampos&#64;avanzosc.es">danielcampos&#64;avanzosc.es</a>&gt;</li> </ul> <a name="maintainer"></a> <h4>Maintainer</h4> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>This module is maintained by the OCA.</p> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>To contribute to this module, please visit <a class="reference external" href="https://odoo-community.org">https://odoo-community.org</a>.</p>