@ -0,0 +1,47 @@ |
|||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
|||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Whatsapp Product Inquiry In Website |
|||
=================================== |
|||
Customers can inquire Website product details through Whatsapp. |
|||
|
|||
Configuration |
|||
============= |
|||
* Need to configure the mobile number to send the message in the Res Company configuration |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
Affero General Public License, Version 3 (AGPL v3). |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developer:(V16) Unnimaya C O, Contact: odoo@cybrosys.com, |
|||
(V17) Ranjith R , Contact: odoo@cybrosys.com, |
|||
(V18) Jumana Jabin MP, Contact: odoo@cybrosys.com, |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Jumana Jabin MP(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
|
|||
############################################################################### |
|||
from . import controllers |
|||
from . import models |
@ -0,0 +1,48 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Jumana Jabin MP(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
|
|||
############################################################################### |
|||
{ |
|||
'name': "Whatsapp Product Inquiry In Website", |
|||
'version': '18.0.1.0.0', |
|||
'category': 'eCommerce', |
|||
'summary': 'Customers can inquire Website product details through Whatsapp', |
|||
'description': """By installing this module, there will be an Inquire |
|||
button in product page of website sale. On clicking that button, customer |
|||
can inquire product details through Whatsapp""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['website_sale'], |
|||
'data': [ |
|||
'views/res_company_views.xml', |
|||
'views/website_sale_templates.xml' |
|||
], |
|||
'assets': { |
|||
'web.assets_frontend': [ |
|||
'whatsapp_product_inquiry/static/src/css/style.css', |
|||
], |
|||
}, |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Jumana Jabin MP(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
|
|||
############################################################################### |
|||
from . import whatsapp_product_inquiry |
@ -0,0 +1,39 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Jumana Jabin MP(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
|
|||
############################################################################### |
|||
import werkzeug |
|||
from odoo import http |
|||
from odoo.http import request |
|||
from odoo.addons.website_sale.controllers.main import WebsiteSale |
|||
|
|||
|
|||
class WebsiteSale(WebsiteSale): |
|||
"""For adding the Whatsapp Inquiry function""" |
|||
|
|||
@http.route(['/whatsapp/inquiry/<int:product>'], type='http', |
|||
auth="public", website=True) |
|||
def whatsapp_product_inquiry(self, **kw): |
|||
"""Redirect to whatsapp web page""" |
|||
return werkzeug.utils.redirect("https://wa.me/%s?text=%s" % ( |
|||
request.website.get_current_website().company_id.whatsapp_number, |
|||
request.website.get_current_website().company_id.message + |
|||
'\nProduct Url: ' + |
|||
request.website.get_base_url() + |
|||
request.env['product.product'].browse(kw['product']).website_url)) |
@ -0,0 +1,5 @@ |
|||
## Module <whatsapp_product_inquiry> |
|||
#### 09.10.2024 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
- Initial commit for Whatsapp Product Inquiry In Website |
@ -0,0 +1,62 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * whatsapp_product_inquiry |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 17.0+e\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2024-07-08 06:15+0000\n" |
|||
"PO-Revision-Date: 2024-07-08 06:15+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: whatsapp_product_inquiry |
|||
#: model_terms:ir.ui.view,arch_db:whatsapp_product_inquiry.whatsapp_inquiry |
|||
msgid "" |
|||
"<i class=\"fa fa-whatsapp mr-2\"/>\n" |
|||
" <span style=\"font-weight: bold\">INQUIRE</span>" |
|||
msgstr "<i class=\"fa fa-whatsapp mr-2\"/>\n" |
|||
" <span style=\"font-weight: bold\">indagar dentro</span>" |
|||
|
|||
#. module: whatsapp_product_inquiry |
|||
#: model:ir.model,name:whatsapp_product_inquiry.model_res_company |
|||
msgid "Companies" |
|||
msgstr "Compañías" |
|||
|
|||
#. module: whatsapp_product_inquiry |
|||
#: model:ir.model.fields,field_description:whatsapp_product_inquiry.field_res_company__message |
|||
msgid "Message" |
|||
msgstr "Mensaje" |
|||
|
|||
#. module: whatsapp_product_inquiry |
|||
#: model:ir.model.fields,help:whatsapp_product_inquiry.field_res_company__whatsapp_number |
|||
msgid "" |
|||
"The Company Whatsapp Number to which the Inquiry messages has to be received" |
|||
msgstr "El número de Whatsapp de la empresa al que se deben recibir los mensajes de consulta." |
|||
|
|||
#. module: whatsapp_product_inquiry |
|||
#: model:ir.model.fields,help:whatsapp_product_inquiry.field_res_company__message |
|||
msgid "This will be the Inquiry message" |
|||
msgstr "Este será el mensaje de consulta." |
|||
|
|||
#. module: whatsapp_product_inquiry |
|||
#: model_terms:ir.ui.view,arch_db:whatsapp_product_inquiry.view_company_form |
|||
msgid "Whatsapp Configuration" |
|||
msgstr "Configuración de whatsapp" |
|||
|
|||
#. module: whatsapp_product_inquiry |
|||
#: model:ir.model.fields,field_description:whatsapp_product_inquiry.field_res_company__whatsapp_number |
|||
msgid "Whatsapp Number" |
|||
msgstr "Número de whatsapp" |
|||
|
|||
#. module: whatsapp_product_inquiry |
|||
#. odoo-python |
|||
#: code:addons/whatsapp_product_inquiry/models/res_company.py:0 |
|||
#, python-format |
|||
msgid "Whatsapp Number should be valid number without any space or signs" |
|||
msgstr "El número de Whatsapp debe ser un número válido sin espacios ni signos." |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Jumana Jabin MP(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
|
|||
############################################################################### |
|||
from . import res_company |
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Jumana Jabin MP(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
|
|||
############################################################################### |
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class ResCompany(models.Model): |
|||
"""Inherits Company for Adding the Whatsapp Fields""" |
|||
_inherit = 'res.company' |
|||
|
|||
whatsapp_number = fields.Char(string='Whatsapp Number', |
|||
help="The Company Whatsapp Number to " |
|||
"which the Inquiry messages has to" |
|||
" be received") |
|||
message = fields.Text(string='Message', |
|||
default="I want to know more details of the product", |
|||
help="This will be the Inquiry message") |
|||
|
|||
@api.constrains('whatsapp_number') |
|||
def _check_whatsapp_number(self): |
|||
"""Validate Mobile Number""" |
|||
if self.whatsapp_number: |
|||
if not self.whatsapp_number.isnumeric() or not len( |
|||
self.whatsapp_number) > 8 or ' ' in self.whatsapp_number: |
|||
raise UserError(_('Whatsapp Number should be valid number' |
|||
' without any space or signs')) |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 187 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 255 KiB |
After Width: | Height: | Size: 199 KiB |
After Width: | Height: | Size: 781 KiB |
After Width: | Height: | Size: 47 KiB |
@ -0,0 +1,13 @@ |
|||
/** Inquire Button styling at different screen size **/ |
|||
|
|||
@media (max-width:440px) { |
|||
div#product_details #whatsapp_inquiry_wrap{ |
|||
margin-left: 0%; |
|||
} |
|||
} |
|||
|
|||
@media (max-width:1390px) { |
|||
div#product_details #whatsapp_inquiry_wrap{ |
|||
margin-left: 0%; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
<?xml version = "1.0" encoding = "UTF-8" ?> |
|||
<odoo> |
|||
<!-- Inherit res.company form view to add whatsapp_number and message |
|||
fields --> |
|||
<record id="view_company_form" model="ir.ui.view"> |
|||
<field name="name"> |
|||
res.company.view.form.inherit.whatsapp.product.inquiry |
|||
</field> |
|||
<field name="inherit_id" ref="base.view_company_form"/> |
|||
<field name="model">res.company</field> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//notebook" position="inside"> |
|||
<page string="Whatsapp Configuration" name="Whatsapp"> |
|||
<group> |
|||
<field name="whatsapp_number"/> |
|||
<field name="message"/> |
|||
</group> |
|||
</page> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,22 @@ |
|||
<?xml version='1.0' encoding='utf-8'?> |
|||
<odoo> |
|||
<!-- Inquire Button in Product Page--> |
|||
<template inherit_id='website_sale.product' id="whatsapp_inquiry" |
|||
name="Product Whatsapp Inquiry"> |
|||
<xpath expr="//div[@id='add_to_cart_wrap']" position="after"> |
|||
<div id="whatsapp_inquiry_wrap" |
|||
style="padding-left:0.2px;" |
|||
class="d-inline-flex align-items-center mb-2 me-auto" |
|||
t-if="bool(request.website.get_current_website().company_id.whatsapp_number)"> |
|||
<a role="button" id="whatsapp_inquiry_link" |
|||
t-att-href="'/whatsapp/inquiry/%s' %(product_variant.id)" |
|||
class="btn btn-primary flex-grow-1 btn-lg" |
|||
style="background-color:#25D366;" |
|||
target="_blank"> |
|||
<i class="fa fa-whatsapp mr-2"/> |
|||
<span style="font-weight: bold">INQUIRE</span> |
|||
</a> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
</odoo> |