Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] website_default_code_product: display the default code attribut… #1011

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions setup/website_default_code_product/setup.py
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,
)
4 changes: 4 additions & 0 deletions website_default_code_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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.
Empty file.
18 changes: 18 additions & 0 deletions website_default_code_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Website Default Code Product",
"category": "Website",
"version": "16.0.1.0.0",
"website": "https://github.com/OCA/website",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "LGPL-3",
"depends": ["website_sale"],
"data": [
"views/website_default_code_product_views.xml",
],
"assets": {
"web.assets_frontend": [
"website_default_code_product/static/src/scss/website_default_code_product.scss",
],
},
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.product_default_code {
min-height: 25px;
padding-top: 9px;
font-size: 0.85em;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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"><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="after">
<span t-if="product.default_code">SKU: <span
t-field="product.default_code"
/></span>
</xpath>
</template>
</odoo>
Loading