Skip to content

Commit

Permalink
[ADD] website_default_code_product: display the default code attribut…
Browse files Browse the repository at this point in the history
…e of the product in both the GRID/LIST views and the product details
  • Loading branch information
ElmerGForgeFlow committed Oct 16, 2023
1 parent 1dec222 commit afcbd6a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
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.
19 changes: 19 additions & 0 deletions website_default_code_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Website Default Code Product",
"category": "Website",
"version": "16.0.1.0.0",
'author': "ForgeFlow",
"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,3 @@
.product_default_code {
min-height: 20px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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" />
</xpath>
</template>

<template id="product" inherit_id="website_sale.product">
<xpath expr="//h1[@itemprop='name']" position="replace">
<p t-field="product.default_code" />
</xpath>
</template>
</odoo>

0 comments on commit afcbd6a

Please sign in to comment.