-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
23 changed files
with
1,040 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/website_sale_loyalty_page/odoo/addons/website_sale_loyalty_page
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_loyalty_page |
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,99 @@ | ||
========================= | ||
Website Sale Loyalty Page | ||
========================= | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
:alt: License: LGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--promotion-lightgray.png?logo=github | ||
:target: https://github.com/OCA/sale-promotion/tree/16.0/website_sale_loyalty_page | ||
:alt: OCA/sale-promotion | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/sale-promotion-16-0/sale-promotion-16-0-website_sale_loyalty_page | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/sale-promotion&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows to publish promotions on Website using banners uploaded to each one. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
To show the promotions/coupons on website you need to: | ||
|
||
#. Go to *Website > eCommerce > Loyalty > Discount & Loyalty*. | ||
#. Select the program that we will publish. | ||
#. In the Website tab, upload an image, add a text or both. | ||
#. Press on the smart button for publishing the loyalty. | ||
|
||
**Note:** The order of the items is defined by a sequence, but the promotions will | ||
appear before the coupons. | ||
|
||
Usage | ||
===== | ||
|
||
When the promotions/coupons are published you can see the result at */promotions*. There | ||
you will see all published items. | ||
|
||
To enlarge the image, just click it. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-promotion/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/sale-promotion/issues/new?body=module:%20website_sale_loyalty_page%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Tecnativa <https://www.tecnativa.com>`_: | ||
|
||
* Pedro M. Baeza | ||
* Carlos Roca | ||
* Stefan Ungureanu | ||
* Pilar Vargas | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/sale-promotion <https://github.com/OCA/sale-promotion/tree/16.0/website_sale_loyalty_page>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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,2 @@ | ||
from . import models | ||
from . import controllers |
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,23 @@ | ||
# Copyright 2021 Tecnativa - Carlos Roca | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
{ | ||
"name": "Website Sale Loyalty Page", | ||
"version": "16.0.1.0.0", | ||
"category": "Website", | ||
"website": "https://github.com/OCA/sale-promotion", | ||
"author": "Tecnativa, Odoo Community Association (OCA)", | ||
"license": "LGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"depends": ["website_sale_loyalty"], | ||
"data": [ | ||
"views/sale_loyalty_program_views.xml", | ||
"templates/promotion_templates.xml", | ||
], | ||
"assets": { | ||
"web.assets_tests": [ | ||
"/website_sale_loyalty_page/static/src/js/website_sale_loyalty_page_portal.js", | ||
] | ||
}, | ||
} |
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 main |
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,31 @@ | ||
# Copyright 2021 Tecnativa - Carlos Roca | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from odoo import http | ||
from odoo.http import request | ||
|
||
|
||
class WebsiteSale(http.Controller): | ||
@http.route(["""/promotions"""], type="http", auth="public", website=True) | ||
def promotion(self, **post): | ||
all_promos = ( | ||
request.env["loyalty.program"] | ||
.sudo() | ||
.search( | ||
[ | ||
("is_published", "=", True), | ||
"|", | ||
("website_id", "=", False), | ||
("website_id", "=", request.env.context.get("website_id")), | ||
] | ||
) | ||
) | ||
values = {"promos": []} | ||
for promo in all_promos: | ||
values["promos"].append( | ||
{ | ||
"id": promo.id, | ||
"image_1920": promo.image_1920, | ||
"public_name": promo.public_name, | ||
} | ||
) | ||
return request.render("website_sale_loyalty_page.promotion_layout", values) |
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,108 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_sale_loyalty_page | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2021-07-16 13:58+0000\n" | ||
"PO-Revision-Date: 2021-07-16 15:59+0200\n" | ||
"Last-Translator: Carlos <[email protected]>\n" | ||
"Language-Team: \n" | ||
"Language: es\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"X-Generator: Poedit 2.0.6\n" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.available_promotions | ||
msgid "<span>No promotions available</span>" | ||
msgstr "<span>No hay promociones disponibles</span>" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__can_publish | ||
msgid "Can Publish" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.promotion_item | ||
msgid "Close" | ||
msgstr "Cerrar" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model,name:website_sale_loyalty_page.model_coupon_program | ||
msgid "Loyalty display on a website" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_1920 | ||
msgid "Image" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_1024 | ||
msgid "Image 1024" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_128 | ||
msgid "Image 128" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_256 | ||
msgid "Image 256" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_512 | ||
msgid "Image 512" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__is_published | ||
msgid "Is Published" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,help:website_sale_loyalty_page.field_coupon_program__public_name | ||
msgid "Name of the promo showed on website bellow the banner image." | ||
msgstr "" | ||
"Nombre de la promoción mostrado en el sitio web debajo del la imagen " | ||
"promocional." | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.promotion_layout | ||
msgid "Promotions" | ||
msgstr "Cupones y Promociones" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__public_name | ||
msgid "Public Name" | ||
msgstr "Nombre público" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,help:website_sale_loyalty_page.field_coupon_program__website_url | ||
msgid "The full URL to access the document through the website." | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__website_published | ||
msgid "Visible on current website" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.coupon_program_view_form_common | ||
msgid "Website" | ||
msgstr "Sitio Web" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__website_url | ||
msgid "Website URL" | ||
msgstr "" | ||
|
||
#~ msgid "Sales Coupon Program" | ||
#~ msgstr "Programa de cupones de ventas" |
99 changes: 99 additions & 0 deletions
99
website_sale_loyalty_page/i18n/website_sale_coupon_page.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,99 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_sale_loyalty_page | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \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_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.available_promotions | ||
msgid "<span>No promotions available</span>" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__can_publish | ||
msgid "Can Publish" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.promotion_item | ||
msgid "Close" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model,name:website_sale_loyalty_page.model_coupon_program | ||
msgid "Loyalty display on a website" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_1920 | ||
msgid "Image" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_1024 | ||
msgid "Image 1024" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_128 | ||
msgid "Image 128" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_256 | ||
msgid "Image 256" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__image_512 | ||
msgid "Image 512" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__is_published | ||
msgid "Is Published" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,help:website_sale_loyalty_page.field_coupon_program__public_name | ||
msgid "Name of the promo showed on website bellow the banner image." | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.promotion_layout | ||
msgid "Promotions" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__public_name | ||
msgid "Public Name" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,help:website_sale_loyalty_page.field_coupon_program__website_url | ||
msgid "The full URL to access the document through the website." | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__website_published | ||
msgid "Visible on current website" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model_terms:ir.ui.view,arch_db:website_sale_loyalty_page.coupon_program_view_form_common | ||
msgid "Website" | ||
msgstr "" | ||
|
||
#. module: website_sale_loyalty_page | ||
#: model:ir.model.fields,field_description:website_sale_loyalty_page.field_coupon_program__website_url | ||
msgid "Website URL" | ||
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 loyalty_program |
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,14 @@ | ||
# Copyright 2021 Tecnativa - Carlos Roca | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class LoyaltyProgram(models.Model): | ||
_name = "loyalty.program" | ||
_inherit = ["loyalty.program", "image.mixin", "website.published.mixin"] | ||
_description = "Loyalty display on a website" | ||
|
||
public_name = fields.Html( | ||
help="Name of the promo showed on website bellow the banner image.", | ||
) |
Oops, something went wrong.