-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
17 changed files
with
812 additions
and
0 deletions.
There are no files selected for viewing
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_whatsapp |
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,91 @@ | ||
================ | ||
Website Whatsapp | ||
================ | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github | ||
:target: https://github.com/OCA/website/tree/15.0/website_whatsapp | ||
:alt: OCA/website | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/website-15-0/website-15-0-website_whatsapp | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/186/15.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Enable a WhatsApp floating button on the website to be able to send a message quickly | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
To configure this module, you need to: | ||
|
||
#. Go to **Website > Configuration > Settings** | ||
#. Search 'Use Whatsapp' option. | ||
#. Fill in your 'WhatsApp number' and the other optional values | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/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/website/issues/new?body=module:%20website_whatsapp%0Aversion:%2015.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 | ||
~~~~~~~ | ||
|
||
* Studio73 | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Studio73 <https://www.studio73.es>`__: | ||
* Ioan Galan <ioan@studio73.es> | ||
|
||
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. | ||
|
||
.. |maintainer-ioans73| image:: https://github.com/ioans73.png?size=40px | ||
:target: https://github.com/ioans73 | ||
:alt: ioans73 | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-ioans73| | ||
|
||
This module is part of the `OCA/website <https://github.com/OCA/website/tree/15.0/website_whatsapp>`_ 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 @@ | ||
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,21 @@ | ||
# Copyright 2022 Studio73 - Ioan Galan <ioan@studio73.es> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Website Whatsapp", | ||
"summary": "Whatsapp integration", | ||
"category": "Website", | ||
"version": "16.0.1.0.0", | ||
"website": "https://github.com/OCA/website", | ||
"author": "Studio73, Odoo Community Association (OCA)", | ||
"maintainers": ["ioans73"], | ||
"license": "AGPL-3", | ||
"depends": ["website"], | ||
"data": [ | ||
"templates/website.xml", | ||
"views/res_config_settings.xml", | ||
], | ||
"assets": { | ||
"web.assets_frontend": ["/website_whatsapp/static/src/scss/website.scss"] | ||
}, | ||
"installable": 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,72 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_whatsapp | ||
# | ||
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_whatsapp | ||
#: model_terms:ir.ui.view,arch_db:website_whatsapp.res_config_settings_view_form | ||
msgid "" | ||
"<span class=\"fa fa-lg fa-globe\" title=\"Values set here are website-" | ||
"specific.\" groups=\"website.group_multi_website\"/>" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model,name:website_whatsapp.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model.fields,field_description:website_whatsapp.field_res_config_settings__whatsapp_text | ||
#: model:ir.model.fields,field_description:website_whatsapp.field_website__whatsapp_text | ||
msgid "Default text for Whatsapp" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model.fields,help:website_whatsapp.field_res_config_settings__whatsapp_text | ||
#: model:ir.model.fields,help:website_whatsapp.field_website__whatsapp_text | ||
msgid "Default text to send as message" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model.fields,help:website_whatsapp.field_res_config_settings__whatsapp_track_url | ||
#: model:ir.model.fields,help:website_whatsapp.field_website__whatsapp_track_url | ||
msgid "" | ||
"Indicate in the user's message the URL of the page from which it was sent" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model.fields,field_description:website_whatsapp.field_res_config_settings__whatsapp_track_url | ||
#: model:ir.model.fields,field_description:website_whatsapp.field_website__whatsapp_track_url | ||
msgid "Track URL" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model.fields,field_description:website_whatsapp.field_res_config_settings__whatsapp_enabled | ||
msgid "Use Whatsapp" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model,name:website_whatsapp.model_website | ||
msgid "Website" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model:ir.model.fields,field_description:website_whatsapp.field_res_config_settings__whatsapp_number | ||
#: model:ir.model.fields,field_description:website_whatsapp.field_website__whatsapp_number | ||
msgid "WhatsApp number" | ||
msgstr "" | ||
|
||
#. module: website_whatsapp | ||
#: model_terms:ir.ui.view,arch_db:website_whatsapp.res_config_settings_view_form | ||
msgid "You must add the mobile number with the country prefix" | ||
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,2 @@ | ||
from . import res_config_settings | ||
from . import website |
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,36 @@ | ||
# Copyright 2022 Studio73 - Ioan Galan <ioan@studio73.es> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
@api.depends("website_id.whatsapp_number") | ||
def _compute_whatsapp_enabled(self): | ||
for record in self: | ||
record.update({"whatsapp_enabled": bool(record.whatsapp_number)}) | ||
|
||
def _inverse_whatsapp_enabled(self): | ||
for record in self: | ||
if not record.whatsapp_enabled: | ||
record.website_id.update({"whatsapp_number": False}) | ||
|
||
whatsapp_number = fields.Char( | ||
related="website_id.whatsapp_number", | ||
readonly=False, | ||
) | ||
whatsapp_text = fields.Char( | ||
related="website_id.whatsapp_text", | ||
readonly=False, | ||
) | ||
whatsapp_track_url = fields.Boolean( | ||
related="website_id.whatsapp_track_url", | ||
readonly=False, | ||
) | ||
whatsapp_enabled = fields.Boolean( | ||
string="Use Whatsapp", | ||
compute="_compute_whatsapp_enabled", | ||
inverse="_inverse_whatsapp_enabled", | ||
) |
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,19 @@ | ||
# Copyright 2022 Studio73 - Ioan Galan <ioan@studio73.es> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class Website(models.Model): | ||
_inherit = "website" | ||
|
||
whatsapp_number = fields.Char(string="WhatsApp number") | ||
whatsapp_text = fields.Char( | ||
"Default text for Whatsapp", | ||
help="Default text to send as message", | ||
) | ||
whatsapp_track_url = fields.Boolean( | ||
"Track URL", | ||
help="Indicate in the user's message the URL of the page from which it " | ||
"was sent", | ||
) |
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,5 @@ | ||
To configure this module, you need to: | ||
|
||
#. Go to **Website > Configuration > Settings** | ||
#. Search 'Use Whatsapp' option. | ||
#. Fill in your 'WhatsApp number' and the other optional 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,2 @@ | ||
* `Studio73 <https://www.studio73.es>`__: | ||
* Ioan Galan <ioan@studio73.es> |
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 @@ | ||
Enable a WhatsApp floating button on the website to be able to send a message quickly |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.