Skip to content

Commit

Permalink
[ADD] website_sale_product_external_link
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Jul 29, 2024
1 parent 0c8cbf3 commit 46b8585
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/website_sale_product_external_link/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,
)
41 changes: 41 additions & 0 deletions website_sale_product_external_link/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==================================
Website Sale Product External Link
==================================

Add external link field to products and display it on the product page.

Description
-----------

This module adds an external link field to products in the backend, allowing you to enter a supplier's page link. This link is displayed on the product page in the webshop.

Usage
-----

- Add a link to the supplier's page in the product form view under the 'Pagina de proveedor' field.
- The link will be displayed on the product page in the webshop, allowing customers to visit the supplier's page.

License
-------

This module is licensed under the AGPL-3 License. See `License Information <http://www.gnu.org/licenses/agpl-3.0-standalone.html>`_.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback.

Credits
=======

Contributors
------------
* Ana Juaristi <[email protected]>
* Unai Beristain <[email protected]>

Do not contact contributors directly about support or help with technical issues.
1 change: 1 addition & 0 deletions website_sale_product_external_link/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions website_sale_product_external_link/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Website Sale Product External Link",
"version": "16.0.1.0.0",
"summary": "Add external link field to products and display it on the product page",
"category": "Website",
"author": "Avanzosc",
"website": "https://github.com/avanzosc/odoo-addons",
"license": "AGPL-3",
"depends": ["website_sale"],
"data": [
"views/product_template_views.xml",
"views/website_sale_templates.xml",
],
"installable": True,
"auto_install": False,
}
35 changes: 35 additions & 0 deletions website_sale_product_external_link/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_external_link
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-29 14:07+0000\n"
"PO-Revision-Date: 2024-07-29 14:07+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_sale_product_external_link
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_product__supplier_page
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_template__supplier_page
msgid "Link to the supplier's page. Example: http://www.example.com"
msgstr "Link a la página del proveedor. Ejemplo: http://example.com"

#. module: website_sale_product_external_link
#: model:ir.model,name:website_sale_product_external_link.model_product_template
msgid "Product"
msgstr "Producto"

#. module: website_sale_product_external_link
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_product__supplier_page
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_template__supplier_page
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.product_detail
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.product_detail_item
msgid "Supplier Webpage"
msgstr "Página Web del Proveedor"
35 changes: 35 additions & 0 deletions website_sale_product_external_link/i18n/eu_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_external_link
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-29 14:08+0000\n"
"PO-Revision-Date: 2024-07-29 14:08+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_sale_product_external_link
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_product__supplier_page
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_template__supplier_page
msgid "Link to the supplier's page. Example: http://www.example.com"
msgstr "Hornitzailearen Web Orrialdera Link-a. Adibidea: http://www.example.com"

#. module: website_sale_product_external_link
#: model:ir.model,name:website_sale_product_external_link.model_product_template
msgid "Product"
msgstr "Produktua"

#. module: website_sale_product_external_link
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_product__supplier_page
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_template__supplier_page
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.product_detail
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.product_detail_item
msgid "Supplier Webpage"
msgstr "Hornitzailearen Web Orrialdea"
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_external_link
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-29 14:08+0000\n"
"PO-Revision-Date: 2024-07-29 14:08+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_sale_product_external_link
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_product__supplier_page
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_template__supplier_page
msgid "Link to the supplier's page. Example: http://www.example.com"
msgstr ""

#. module: website_sale_product_external_link
#: model:ir.model,name:website_sale_product_external_link.model_product_template
msgid "Product"
msgstr ""

#. module: website_sale_product_external_link
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_product__supplier_page
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_template__supplier_page
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.product_detail
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.product_detail_item
msgid "Supplier Webpage"
msgstr ""
1 change: 1 addition & 0 deletions website_sale_product_external_link/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_template
10 changes: 10 additions & 0 deletions website_sale_product_external_link/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import fields, models


class ProductTemplate(models.Model):
_inherit = "product.template"

supplier_page = fields.Char(
string="Supplier Webpage",
help="Link to the supplier's page. Example: http://www.example.com",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_product_template_form_inherit" model="ir.ui.view">
<field name="name">product.template.form.inherit.external.link</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<xpath expr="//notebook/page/group[2]" position="after">
<group name="supplier_page" string="Supplier Webpage">
<field name="supplier_page" />
</group>
</xpath>
</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="product_detail" inherit_id="website_sale.product">
<xpath expr="//h1[@itemprop='name']" position="after">
<t t-if="product.supplier_page">
<div class="oe_structure" />
<div class="mt16">
<a
t-att-href="product.supplier_page"
target="_blank"
>Supplier Webpage</a>
</div>
</t>
</xpath>
</template>
<template id="product_detail_item" inherit_id="website_sale.products_item">
<xpath expr="//form/div[2]" position="after">
<t t-if="product.supplier_page">
<div class="oe_structure" />
<div class="mt16">
<a
t-att-href="product.supplier_page"
target="_blank"
>Supplier Webpage</a>
</div>
</t>
</xpath>
</template>
</odoo>

0 comments on commit 46b8585

Please sign in to comment.