-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] website_sale_product_external_link
- Loading branch information
Showing
12 changed files
with
225 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/website_sale_product_external_link/odoo/addons/website_sale_product_external_link
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_sale_product_external_link |
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 |
---|---|---|
@@ -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. |
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 @@ | ||
from . import models |
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,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, | ||
} |
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,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" |
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,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" |
35 changes: 35 additions & 0 deletions
35
website_sale_product_external_link/i18n/website_sale_product_external_link.pot
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,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 "" |
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 @@ | ||
from . import product_template |
10 changes: 10 additions & 0 deletions
10
website_sale_product_external_link/models/product_template.py
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,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", | ||
) |
15 changes: 15 additions & 0 deletions
15
website_sale_product_external_link/views/product_template_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 |
---|---|---|
@@ -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> |
29 changes: 29 additions & 0 deletions
29
website_sale_product_external_link/views/website_sale_templates.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 |
---|---|---|
@@ -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> |