Search 1.9 billion lines of Odoo code on GitHub

product_default_image

Author: LasLabs, Odoo Community Association (OCA)
License: LGPL-3
Branch: 10.0
Repository: 2FM/product-attribute
Dependencies: product, and stock
Languages: PO File (806, 34.6%), Python (1328, 57.0%), XML (110, 4.7%), and reStructuredText (87, 3.7%)
Other repositories: 020cui/product-attribute, AITIC/product-attribute, AbrahamTrey/product-attribute, AladroLiderit/product-attribute, Alfa-90/product-attribute, BitStab/product-attribute, CB-Gran-Canaria/product-attribute, Callino/product-attribute, Change2improve/product-attribute, ClearCorp/oca-product-attribute, Colorlessgold/product-attribute, Daniel-CA/product-attribute, Darknroses/product-attribute, DjaitaiKoffi/product-attribute, Dobtor-OCA/product-attribute, Domatix/product-attribute, DucTruongKomit/product-attribute, ERPLibre/product-attribute, ForgeFlow/product-attribute, GSLabIt/product-attribute, Gabinete-Digital/product-attribute, Gofekra/product-attribute, GrupoAlvamex/product-attribute, Guobower/OCA-product-attribute, HarshalBhoir/product-attribute, Ingeos/product-attribute, Jarsa/product-attribute, Jeisonpernia/product-attribute, JibenCL/product-attribute, Joaco1980/product-attribute, JoanMarin/product-attribute, JuanjoA/product-attribute, KasperDeclercq/product-attribute, KolushovAlexandr/product-attribute, LasLabs/product-attribute, LevelPrime/product-attribute, MadsackMediaStore/product-attribute, Martronic-SA/product-attribute, MathBenTech/product-attribute, Mefistous/product-attribute, Menestrels/product-attribute, MjAbuz/product-attribute, NL66278/product-attribute, NachoAlesLopez/product-attribute, NeatNerdPrime/product-attribute, Nikul-Chaudhary/product-attribute, Numigi/odoo-product-attribute, OCA-MUK/product-attribute, OCA/product-attribute, ORETEK/product-attribute, Odoo-Italia-Associazione/product-attribute, PlanetaTIC/product-attribute, PortalFl0w/product-attribute, Rad0van/product-attribute, RosleStores/product-attribute, Saharaintergroup/product-attribute, SanteLibre/product-attribute, SequarSrl/product-attribute, SeuMarco/product-attribute, SportPursuit/product-attribute, Studio73/product-attribute, TDu/product-attribute, TRESCLOUD/product-attribute, Tonow-c2c/product-attribute, VisiionSolucionesTecnologicas/product-attribute, acsone/product-attribute, agrista/odoo-product-attribute, agyamuta/product-attribute, akretion/product-attribute, algiopensource/product-attribute, amendoncabh/product-attribute, anhvu-sg/product-attribute, ansinaesmejor/product-attribute, apertoso/product-attribute, apetbiz/product-attribute, arun-art06/product-attribute, aurestic/product-attribute, avoinsystems/product-attribute, bealdav/product-attribute, binovo/product-attribute, bitodoo/product-attribute, bizzappdev/product-attribute, bizzappdevteam/product-attribute, brain-tec/product-attribute, brainbeanapps/product-attribute, brocoloco/product-attribute, bvkl/product-attribute, camptocamp/product-attribute, chenjingxiong/product-attribute, cnfengyuan/product-attribute, conroyke56/product-attribute, coopiteasy/product-attribute, cubells/product-attribute, cybernexus/product-attribute, damcar/product-attribute, damdam-s/product-attribute, danieldeyris/product-attribute, daramousk/product-attribute, digitalsatori/product-attribute, domcolas/product-attribute, dong-z/product-attribute, drashtigotecha/product-attribute, dreispt/product-attribute, druidoo-dev/product-attribute, ecosoft-odoo/product-attribute, ehsu0407/product-attribute, emagdalenaC2i/product-attribute, ernestotejeda/product-attribute, erp-sysvine/product-attribute, esantos-octagono/product-attribute, estraka/product-attribute, eversatis/product-attribute, exosoftware/oca-product-attribute, fanha99/product-attribute, feketemihai/product-attribute, filoquin/product-attribute, foah/product-attribute, fshah-initos/product-attribute, gurneyalex/product-attribute, gustavovalverde/product-attribute, gustitammam/product-attribute, haroldtamo/product-attribute, hibou-io/oca-product-attribute, hprasetyou/product-attribute, i-vyshnevska/product-attribute, iamyeonhan/product-attribute, imremazsar/product-attribute, initOS/product-attribute, jasonlc1478/product-attribute, jhumfer/product-attribute, jimmyec/product-attribute, jjscarafia/product-attribute, joergfederspiel/product-attribute, joseluisbossio/product-attribute, jvpascual/product-attribute, kevinkhao/product-attribute, kholioeg/product-attribute, kittiu/product-attribute, kmee/product-attribute, kos94ok-3D/product-attribute, lideritjnma/product-attribute, maiolif/product-attribute, maljac/product-attribute, niulinlnc/product-attribute, noorealam96/product-attribute, nouhl/product-attribute, ntsirintanis/product-attribute, omalbastin/product-attribute, one2pret/product-attribute, osvalr/product-attribute, ovnicraft/product-attribute, p-tombez/product-attribute, phuctranerp/product-attribute, popcomputadores-desenv/product-attribute, presenceverte/product-attribute, pscloud/product-attribute, puchisco/product-attribute, pythoner-3k/product-attribute, qtheuret/product-attribute, quadit/product-attribute, quentinDupont/product-attribute, raizs/product-attribute, rdeheele/product-attribute, redblow/product-attribute, royalline1/product-attribute, rsullivan2704/product-attribute, rven/product-attribute, sacodoo/product-attribute, safecoms/product-attribute, samsagaz/product-attribute, sanube/product-attribute, sc4you/product-attribute, sendalpegat/product-attribute, sewisoft/product-attribute, shepilov-vladislav/product-attribute, simplifysolutions/product-attribute, smurf-U/product-attribute, solvosci/product-attribute, sudhir-erpharbor/product-attribute, sunflowerit/product-attribute, sunshineLhj/product-attribute, takinobori/oca-product-attribute, takobi-online/product-attribute, tbaden/product-attribute, tegin/product-attribute, tonygalmiche/product-attribute, uktc87504/product-attribute, unitek-solusi/OCA-product-attribute, unwasted/product-attribute, urbmend26/product-attribute, ursais/product-attribute, usmcgwg/product-attribute, valley51/product-attribute, valmarnet/product-attribute, vatsalaxis/product-attribute, vdedyukhin/product-attribute, versada/product-attribute, vialaurea/OCA-product-attribute, vinclar/product-attribute, visztani/product-attribute, wahello/product-attribute, westlyou/product-attribute, willmakenoise/product-attribute, wrhansen/product-attribute, x0rzkov/odoo-product-attribute, xt0ph/product-attribute, xtendoo-corporation/product-attribute, xtof-osd/product-attribute, y2gsmith/product-attribute, yasmanycastillo/product-attribute, ypapouin/product-attribute, yuriqp/product-attribute, zeroheure/product-attribute, zeroincombenze/product-attribute, and zhuyangbin/product-attribute

<a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.svg"> </a> <a name="default-product-images"></a> <h2>Default Product Images</h2> <p>This module adds default images to products with the ability to map their images to their <cite>Category's Image</cite>, to a single, <cite>Global Product Image</cite>, or to both, <cite>Global and Category</cite>, where global acts as a backup if the category has no image. You can also disable default images by choosing <cite>No Default Image</cite>.</p> <a name="usage"></a> <h3>Usage</h3> <p>There are a few notable features in this module, see below:</p> <a name="post-installation"></a> <h4>Post Installation</h4> <p>After installation, all products with no image will be automatically changed when you change your company's <cite>Product Image Target</cite> (see Stock Configuration Page). Since the default option is <cite>No Default Image</cite>, your product images will remain untouched during installation.</p> <a name="when-will-product-images-be-automatically-changed"></a> <h4>When Will Product Images Be Automatically Changed?</h4> <ul class="simple"> <li>Product images will automatically change when you change <cite>Default Product Image</cite> in the stock configuration page.</li> <li>Product images will also be changed if you change the product's category in the product form. This only applies if the <cite>Default Product Image</cite> is set to <cite>Category's Image</cite> or <cite>Global and Category</cite>.</li> <li>Lastly, product images will be automatically changed if you change the image on their category's image. Again, only applicable if <cite>Default Product Image</cite> is set to <cite>Category's Image</cite> or <cite>Global and Category</cite>.</li> </ul> <p>The above rules only apply to your current products that do not have an image. Products that already have an image when installing this module will be marked as <cite>custom</cite> images. The images on those products will not change unless you click the <cite>Apply Default Image</cite> in the product form view.</p> <a name="stock-configuration-page"></a> <h4>Stock Configuration Page</h4> <ul class="simple"> <li>Go to <cite>Inventory</cite> in the top header.</li> <li>Under <cite>Configuration</cite>, click <cite>Settings</cite>.</li> <li>Under <cite>Products</cite> is a field, <cite>Default Product Image</cite>.</li> <li><cite>No Default Image</cite> deletes all eligible product images.</li> <li><cite>Global Product Image</cite> sets all eligible product images to the <cite>Global Product Image</cite> field that shows up below.</li> <li><cite>Category's Image</cite> sets all eligible product images to their category's image.</li> <li><cite>Global and Category</cite> sets all eligible product images to their category's image if that category has an image. Otherwise the image is set to the <cite>Global Product Image</cite>.</li> </ul> <p>Eligible refers to products that have Auto Change Image as True, do not have an image, do not have a custom image, or have a default image already.</p> <a name="product-category-form-view"></a> <h4>Product Category Form View</h4> <ul class="simple"> <li>Image fields have been added to categories</li> <li>Changing the category's image field will also change product images that are tied to that category. Only applicable if <cite>Default Product Image</cite> is set to <cite>Category's Image</cite> or <cite>Global and Category</cite></li> </ul> <a name="product-form-view"></a> <h4>Product Form View</h4> <ul class="simple"> <li>Go to <cite>Inventory</cite> in the top header.</li> <li>Under <cite>Inventory Control</cite>, click <cite>Products</cite>.</li> <li>Click on a product.</li> <li>In the product form view, you'll see in the upper left hand corner a new button which says <cite>Apply Default Image</cite>. Use this button if you want to change a custom image to a default one, or reset a default image.</li> <li>Go to a product that has a default or no image, and you'll see a new field under the <cite>General Information</cite> tab called <cite>Auto Change Image</cite>. Uncheck this field if you want the image not to change. When uploading a custom image you don't have to worry about this field. However if you want to delete a product's image and keep it from automatically changing, make sure to uncheck <cite>Auto Change Image</cite>.</li> </ul> <p>All image defaults are also loaded when you create a new product.</p> <a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/135/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> <ul class="simple"> <li>Refactor product.template _change_template_image method</li> <li>Centralize logic that converts the company product_image_target to the correct product image_type value (usually in the form of a to_type arg), accounting for GLOBAL_CATEGORY. Repetitive logic occurs in: product.template apply_default_image, product.template _onchange_categ_id, product.template default_get, res.company write, and product.category write methods.</li> <li>After logic is centralized, add a res.company create method overload that auto-populates product images.</li> </ul> <a name="bug-tracker"></a> <h3>Bug Tracker</h3> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-attribute/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> <li>Company Default Product Image: <a class="reference external" href="https://openclipart.org/detail/98491/open-box">Image</a>.</li> </ul> <a name="contributors"></a> <h4>Contributors</h4> <ul class="simple"> <li>Brett Wood &lt;<a class="reference external" href="mailto:bwood&#64;laslabs.com">bwood&#64;laslabs.com</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="http://odoo-community.org">http://odoo-community.org</a>.</p>