Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] website_whatsapp: Migration to 16.0 #943

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <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.
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 <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,
}
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 <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)})

Check warning on line 13 in website_whatsapp/models/res_config_settings.py

View check run for this annotation

Codecov / codecov/patch

website_whatsapp/models/res_config_settings.py#L13

Added line #L13 was not covered by tests

def _inverse_whatsapp_enabled(self):
for record in self:
if not record.whatsapp_enabled:
record.website_id.update({"whatsapp_number": False})

Check warning on line 18 in website_whatsapp/models/res_config_settings.py

View check run for this annotation

Codecov / codecov/patch

website_whatsapp/models/res_config_settings.py#L18

Added line #L18 was not covered by tests

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 <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",
)
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 <ioan@studio73.es>
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
Loading