Skip to content

Commit

Permalink
[IMP] Show a default 'OCA' icon on product
Browse files Browse the repository at this point in the history
When the related module has no icon, show a default 'OCA' icon
from the static path.
  • Loading branch information
StephanRozendaal authored and Ernesto Tejeda committed Aug 24, 2021
1 parent 1ce1c1c commit 6c678db
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Binary file added website_apps_store/static/src/img/oca.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion website_apps_store/views/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,16 @@
<xpath expr='//div[hasclass("product_price")]//span[@t-esc="product.website_price"]' position="replace">
<span t-esc="product.website_price" t-options="{'widget': 'monetary', 'display_currency': website.currency_id}" t-if="not product.odoo_module_id"/>
</xpath>

<xpath expr="//div[hasclass('oe_product_image')]/a/span" position="replace">
<t t-if="product.image or not product.odoo_module_id" >
<span itemprop="image" t-attf-content="{{request.httprequest.url_root}}web/image/product.template/{{product.id}}/image" t-field="product.image" t-options="{'widget': 'image', 'resize': None if product_image_big else '300x300', 'zoom': 'image'}" t-att-alt="product.name" />
</t>
<t t-else="">
<span itemprop="image" t-att-alt="product.name">
<img class="img img-responsive" t-attf-src="{{request.httprequest.url_root}}website_apps_store/static/src/img/oca.png" t-options="{'widget': 'image', 'zoom': 'image'}" t-att-alt="product.name" />
</span>
</t>
</xpath>
</template>

<!--Product Customization /-->
Expand Down Expand Up @@ -204,6 +213,16 @@
<p t-esc="product_var_id.app_description_rst_html" t-options='{"widget": "html"}'/>
</div>
</xpath>
<xpath expr="//span[contains(@t-field, 'product.image')]" position="replace">
<t t-if="product.image or not product.odoo_module_id" >
<span itemprop="image" t-attf-content="{{request.httprequest.url_root}}web/image/product.template/{{product.id}}/image" t-field="product.image" t-options="{'widget': 'image', 'class': 'product_detail_img', 'alt-field': 'name', 'zoom': 'image'}" groups="!website_sale.group_website_multi_image"/>
</t>
<t t-else="">
<span itemprop="image" t-att-alt="product.name" >
<img class="img img-responsive product_detail_img" t-attf-src="{{request.httprequest.url_root}}website_apps_store/static/src/img/oca.png" t-options="{'widget': 'image', 'zoom': 'image'}" t-att-alt="product.name" />
</span>
</t>
</xpath>
</template>
<template id="product_quantity_customize" inherit_id="website_sale.product_quantity">
<xpath expr='//div[hasclass("css_quantity")]' position="attributes">
Expand Down

0 comments on commit 6c678db

Please sign in to comment.