-
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
266 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 external page link. This link is displayed on the product page in the webshop. | ||
|
||
Usage | ||
----- | ||
|
||
- Add a link to an external page in the product form view under the "Website Link" field. | ||
- The link will be displayed on the product page in the webshop, allowing customers to visit an external 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,44 @@ | ||
# 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 15:48+0000\n" | ||
"PO-Revision-Date: 2024-07-29 15:48+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_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 "A short description that will also appear on documents." | ||
msgstr "Una breve descripción que aparecerás en los documentos." | ||
|
||
#. module: website_sale_product_external_link | ||
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_product__website_link | ||
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_template__website_link | ||
msgid "Website page. Example: http://www.example.com" | ||
msgstr "Página web. Ejemplo: http://www.ejemplo.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__website_link | ||
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_template__website_link | ||
msgid "Website Link" | ||
msgstr "Enlace Web" | ||
|
||
#. module: website_sale_product_external_link | ||
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.view_product_template_form_inherit | ||
msgid "Website Link" | ||
msgstr "Enlace Web" |
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,44 @@ | ||
# 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 15:49+0000\n" | ||
"PO-Revision-Date: 2024-07-29 15:49+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_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 "A short description that will also appear on documents." | ||
msgstr "" | ||
|
||
#. module: website_sale_product_external_link | ||
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_product__website_link | ||
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_template__website_link | ||
msgid "Website page. Example: http://www.example.com" | ||
msgstr "Web orrialdea. Adibidez: 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__website_link | ||
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_template__website_link | ||
msgid "Website Link" | ||
msgstr "Web orrialdearen lotura" | ||
|
||
#. module: website_sale_product_external_link | ||
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.view_product_template_form_inherit | ||
msgid "Website Link" | ||
msgstr "Web orrialdearen lotura" |
44 changes: 44 additions & 0 deletions
44
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,44 @@ | ||
# 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 15:47+0000\n" | ||
"PO-Revision-Date: 2024-07-29 15:47+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_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 "A short description that will also appear on documents." | ||
msgstr "" | ||
|
||
#. module: website_sale_product_external_link | ||
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_product__website_link | ||
#: model:ir.model.fields,help:website_sale_product_external_link.field_product_template__website_link | ||
msgid "Website 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__website_link | ||
#: model:ir.model.fields,field_description:website_sale_product_external_link.field_product_template__website_link | ||
msgid "Website Link" | ||
msgstr "" | ||
|
||
#. module: website_sale_product_external_link | ||
#: model_terms:ir.ui.view,arch_db:website_sale_product_external_link.view_product_template_form_inherit | ||
msgid "Website Link" | ||
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" | ||
|
||
website_link = fields.Char( | ||
string="Website Link", | ||
help="Website 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="website_link" string="Website Link"> | ||
<field name="website_link" /> | ||
</group> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
43 changes: 43 additions & 0 deletions
43
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,43 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template id="product_detail" inherit_id="website_sale.product"> | ||
<xpath expr="//div[@id='product_details']/p[1]" position="attributes"> | ||
<attribute name="t-if">False</attribute> | ||
</xpath> | ||
<xpath expr="//div[@id='product_details']/p[1]" position="after"> | ||
|
||
<t t-if="product.website_link"> | ||
<a t-att-href="product.website_link" target="_blank"> | ||
<p | ||
t-field="product.description_sale" | ||
class="text-muted my-2" | ||
placeholder="A short description that will also appear on documents." | ||
/> | ||
</a> | ||
</t> | ||
<t t-else=""> | ||
<p | ||
t-field="product.description_sale" | ||
class="text-muted my-2" | ||
placeholder="A short description that will also appear on documents." | ||
/> | ||
</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.website_link"> | ||
<div class="oe_structure" /> | ||
<div class="mt16"> | ||
<a t-att-href="product.website_link" target="_blank"> | ||
<span | ||
t-field="product.description_sale" | ||
class="text-muted my-2" | ||
placeholder="A short description that will also appear on documents." | ||
/> | ||
</a> | ||
</div> | ||
</t> | ||
</xpath> | ||
</template> | ||
</odoo> |