From 2e8e371d12c042a8e89e02b47cf55dd21f8aefec Mon Sep 17 00:00:00 2001 From: Elmer Garcia Yavi Date: Mon, 16 Oct 2023 09:46:12 +0200 Subject: [PATCH 1/2] [ADD] website_default_code_product: display the default code attribute of the product in both the GRID/LIST views and the product details --- website_default_code_product/README.rst | 4 ++++ website_default_code_product/__init__.py | 0 website_default_code_product/__manifest__.py | 19 +++++++++++++++++++ .../scss/website_default_code_product.scss | 3 +++ .../website_default_code_product_views.xml | 14 ++++++++++++++ 5 files changed, 40 insertions(+) create mode 100644 website_default_code_product/README.rst create mode 100644 website_default_code_product/__init__.py create mode 100644 website_default_code_product/__manifest__.py create mode 100644 website_default_code_product/static/src/scss/website_default_code_product.scss create mode 100644 website_default_code_product/views/website_default_code_product_views.xml diff --git a/website_default_code_product/README.rst b/website_default_code_product/README.rst new file mode 100644 index 0000000000..6f37c4d240 --- /dev/null +++ b/website_default_code_product/README.rst @@ -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. \ No newline at end of file diff --git a/website_default_code_product/__init__.py b/website_default_code_product/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/website_default_code_product/__manifest__.py b/website_default_code_product/__manifest__.py new file mode 100644 index 0000000000..492a2367d6 --- /dev/null +++ b/website_default_code_product/__manifest__.py @@ -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, +} \ No newline at end of file diff --git a/website_default_code_product/static/src/scss/website_default_code_product.scss b/website_default_code_product/static/src/scss/website_default_code_product.scss new file mode 100644 index 0000000000..f5260b5046 --- /dev/null +++ b/website_default_code_product/static/src/scss/website_default_code_product.scss @@ -0,0 +1,3 @@ +.product_default_code { + min-height: 20px; +} \ No newline at end of file diff --git a/website_default_code_product/views/website_default_code_product_views.xml b/website_default_code_product/views/website_default_code_product_views.xml new file mode 100644 index 0000000000..c2416ae690 --- /dev/null +++ b/website_default_code_product/views/website_default_code_product_views.xml @@ -0,0 +1,14 @@ + + + + + + From 170c53a9d914b557212273021c39b1a4919cce52 Mon Sep 17 00:00:00 2001 From: Elmer Garcia Yavi Date: Mon, 23 Oct 2023 17:10:24 +0200 Subject: [PATCH 2/2] [UPDATE] website_default_code: add label SKU and applies styling --- .../odoo/addons/website_default_code_product | 1 + setup/website_default_code_product/setup.py | 6 ++++++ website_default_code_product/README.rst | 2 +- website_default_code_product/__manifest__.py | 9 ++++----- .../src/scss/website_default_code_product.scss | 6 ++++-- .../views/website_default_code_product_views.xml | 12 ++++++++---- 6 files changed, 24 insertions(+), 12 deletions(-) create mode 120000 setup/website_default_code_product/odoo/addons/website_default_code_product create mode 100644 setup/website_default_code_product/setup.py diff --git a/setup/website_default_code_product/odoo/addons/website_default_code_product b/setup/website_default_code_product/odoo/addons/website_default_code_product new file mode 120000 index 0000000000..c489925880 --- /dev/null +++ b/setup/website_default_code_product/odoo/addons/website_default_code_product @@ -0,0 +1 @@ +../../../../website_default_code_product \ No newline at end of file diff --git a/setup/website_default_code_product/setup.py b/setup/website_default_code_product/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/website_default_code_product/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/website_default_code_product/README.rst b/website_default_code_product/README.rst index 6f37c4d240..8b0ae6aa31 100644 --- a/website_default_code_product/README.rst +++ b/website_default_code_product/README.rst @@ -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. \ No newline at end of file +This module displays the default code attribute of the product in both the GRID/LIST views and the product details. diff --git a/website_default_code_product/__manifest__.py b/website_default_code_product/__manifest__.py index 492a2367d6..a0f017303c 100644 --- a/website_default_code_product/__manifest__.py +++ b/website_default_code_product/__manifest__.py @@ -2,11 +2,10 @@ "name": "Website Default Code Product", "category": "Website", "version": "16.0.1.0.0", - 'author': "ForgeFlow", + "website": "https://github.com/OCA/website", + "author": "ForgeFlow, Odoo Community Association (OCA)", "license": "LGPL-3", - "depends": [ - "website_sale" - ], + "depends": ["website_sale"], "data": [ "views/website_default_code_product_views.xml", ], @@ -16,4 +15,4 @@ ], }, "installable": True, -} \ No newline at end of file +} diff --git a/website_default_code_product/static/src/scss/website_default_code_product.scss b/website_default_code_product/static/src/scss/website_default_code_product.scss index f5260b5046..a75661457e 100644 --- a/website_default_code_product/static/src/scss/website_default_code_product.scss +++ b/website_default_code_product/static/src/scss/website_default_code_product.scss @@ -1,3 +1,5 @@ .product_default_code { - min-height: 20px; -} \ No newline at end of file + min-height: 25px; + padding-top: 9px; + font-size: 0.85em; +} diff --git a/website_default_code_product/views/website_default_code_product_views.xml b/website_default_code_product/views/website_default_code_product_views.xml index c2416ae690..1827eef14e 100644 --- a/website_default_code_product/views/website_default_code_product_views.xml +++ b/website_default_code_product/views/website_default_code_product_views.xml @@ -1,14 +1,18 @@ - +