-
-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UPDATE] website_default_code: add label SKU and applies styling
- Loading branch information
1 parent
2e8e371
commit 170c53a
Showing
6 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/website_default_code_product/odoo/addons/website_default_code_product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../website_default_code_product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
============================ | ||
Website Default Code Product | ||
============================ | ||
This module displays the default code attribute of the product in both the GRID/LIST views and the product details. | ||
This module displays the default code attribute of the product in both the GRID/LIST views and the product details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
website_default_code_product/static/src/scss/website_default_code_product.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.product_default_code { | ||
min-height: 20px; | ||
} | ||
min-height: 25px; | ||
padding-top: 9px; | ||
font-size: 0.85em; | ||
} |
12 changes: 8 additions & 4 deletions
12
website_default_code_product/views/website_default_code_product_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template id="products_item" inherit_id="website_sale.products_item"> | ||
<xpath expr="//a[@itemprop='name']" position="after"> | ||
<p t-attf-class="product_default_code" t-field="product.default_code" /> | ||
<p t-attf-class="product_default_code"><span | ||
t-if="product.default_code" | ||
>SKU: <span t-field="product.default_code" /></span></p> | ||
</xpath> | ||
</template> | ||
|
||
<template id="product" inherit_id="website_sale.product"> | ||
<xpath expr="//h1[@itemprop='name']" position="replace"> | ||
<p t-field="product.default_code" /> | ||
<xpath expr="//h1[@itemprop='name']" position="after"> | ||
<span t-if="product.default_code">SKU: <span | ||
t-field="product.default_code" | ||
/></span> | ||
</xpath> | ||
</template> | ||
</odoo> |