Skip to content

Commit

Permalink
Merge PR #943 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 30, 2023
2 parents ea8f777 + 1ae761d commit 7983778
Show file tree
Hide file tree
Showing 17 changed files with 812 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup/website_whatsapp/odoo/addons/website_whatsapp
6 changes: 6 additions & 0 deletions setup/website_whatsapp/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,
)
91 changes: 91 additions & 0 deletions website_whatsapp/README.rst
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 <[email protected]>

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.
1 change: 1 addition & 0 deletions website_whatsapp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions website_whatsapp/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Studio73 - Ioan Galan <[email protected]>
# 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,
}
72 changes: 72 additions & 0 deletions website_whatsapp/i18n/website_whatsapp.pot
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 ""
2 changes: 2 additions & 0 deletions website_whatsapp/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import res_config_settings
from . import website
36 changes: 36 additions & 0 deletions website_whatsapp/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2022 Studio73 - Ioan Galan <[email protected]>
# 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",
)
19 changes: 19 additions & 0 deletions website_whatsapp/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022 Studio73 - Ioan Galan <[email protected]>
# 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",
)
5 changes: 5 additions & 0 deletions website_whatsapp/readme/CONFIGURE.rst
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
2 changes: 2 additions & 0 deletions website_whatsapp/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* `Studio73 <https://www.studio73.es>`__:
* Ioan Galan <[email protected]>
1 change: 1 addition & 0 deletions website_whatsapp/readme/DESCRIPTION.rst
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
Binary file added website_whatsapp/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7983778

Please sign in to comment.