Browse Source

July 4: [ADD] Initial commit 'odoo_google_contact_integration'

pull/254/merge
RisvanaCybro 10 months ago
parent
commit
4394de17d1
  1. 48
      odoo_google_contact_integration/README.rst
  2. 23
      odoo_google_contact_integration/__init__.py
  3. 43
      odoo_google_contact_integration/__manifest__.py
  4. 22
      odoo_google_contact_integration/controllers/__init__.py
  5. 73
      odoo_google_contact_integration/controllers/google_contact_integration.py
  6. 6
      odoo_google_contact_integration/doc/RELEASE_NOTES.md
  7. 23
      odoo_google_contact_integration/models/__init__.py
  8. 177
      odoo_google_contact_integration/models/res_company.py
  9. 162
      odoo_google_contact_integration/models/res_partner.py
  10. BIN
      odoo_google_contact_integration/static/description/assets/icons/check.png
  11. BIN
      odoo_google_contact_integration/static/description/assets/icons/chevron.png
  12. BIN
      odoo_google_contact_integration/static/description/assets/icons/cogs.png
  13. BIN
      odoo_google_contact_integration/static/description/assets/icons/consultation.png
  14. BIN
      odoo_google_contact_integration/static/description/assets/icons/ecom-black.png
  15. BIN
      odoo_google_contact_integration/static/description/assets/icons/education-black.png
  16. BIN
      odoo_google_contact_integration/static/description/assets/icons/hotel-black.png
  17. BIN
      odoo_google_contact_integration/static/description/assets/icons/license.png
  18. BIN
      odoo_google_contact_integration/static/description/assets/icons/lifebuoy.png
  19. BIN
      odoo_google_contact_integration/static/description/assets/icons/logo.png
  20. BIN
      odoo_google_contact_integration/static/description/assets/icons/manufacturing-black.png
  21. BIN
      odoo_google_contact_integration/static/description/assets/icons/pos-black.png
  22. BIN
      odoo_google_contact_integration/static/description/assets/icons/puzzle.png
  23. BIN
      odoo_google_contact_integration/static/description/assets/icons/restaurant-black.png
  24. BIN
      odoo_google_contact_integration/static/description/assets/icons/service-black.png
  25. BIN
      odoo_google_contact_integration/static/description/assets/icons/trading-black.png
  26. BIN
      odoo_google_contact_integration/static/description/assets/icons/training.png
  27. BIN
      odoo_google_contact_integration/static/description/assets/icons/update.png
  28. BIN
      odoo_google_contact_integration/static/description/assets/icons/user.png
  29. BIN
      odoo_google_contact_integration/static/description/assets/icons/wrench.png
  30. BIN
      odoo_google_contact_integration/static/description/assets/modules/1.png
  31. BIN
      odoo_google_contact_integration/static/description/assets/modules/2.png
  32. BIN
      odoo_google_contact_integration/static/description/assets/modules/3.png
  33. BIN
      odoo_google_contact_integration/static/description/assets/modules/4.png
  34. BIN
      odoo_google_contact_integration/static/description/assets/modules/5.png
  35. BIN
      odoo_google_contact_integration/static/description/assets/modules/6.png
  36. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/1.png
  37. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/10.png
  38. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/11.png
  39. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/12.png
  40. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/13.png
  41. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/14.png
  42. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/15.png
  43. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/16.png
  44. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/17.png
  45. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/18.png
  46. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/19.png
  47. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/2.png
  48. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/20.png
  49. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/21.png
  50. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/22.png
  51. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/3.png
  52. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/4.png
  53. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/5.png
  54. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/6.png
  55. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/7.png
  56. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/8.png
  57. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/9.png
  58. BIN
      odoo_google_contact_integration/static/description/assets/screenshots/hero.gif
  59. BIN
      odoo_google_contact_integration/static/description/banner.jpg
  60. BIN
      odoo_google_contact_integration/static/description/icon.png
  61. 906
      odoo_google_contact_integration/static/description/index.html
  62. 55
      odoo_google_contact_integration/views/res_company_views.xml
  63. 60
      odoo_google_contact_integration/views/res_partner_views.xml

48
odoo_google_contact_integration/README.rst

@ -0,0 +1,48 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
Google Contact Connector
========================
* Google Contact Connector module helps to Synchronize Google Contacts.
Configuration
=============
* Configuration depicted in Index files
License
-------
General Public License, Version 3 (LGPL v3).
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html)
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developer:
(V15) Jumana Haseen,
(V16) Gion Dany,
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 https://www.cybrosys.com
Further information
===================
HTML Description: `<static/description/index.html>`__

23
odoo_google_contact_integration/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Haseen(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import controllers
from . import models

43
odoo_google_contact_integration/__manifest__.py

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Haseen (<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
{
'name': "Google Contact Connector",
'version': '15.0.1.0.0',
"category": "Extra Tools",
'summary': """Synchronize Google Contacts (Import/Export).""",
'description': """The Google Contact Connector module helps you import
Google contacts from Odoo and export Google contacts to Odoo.""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['contacts'],
'data': [
'views/res_company_views.xml',
'views/res_partner_views.xml'
],
'images': ['static/description/banner.jpg'],
'license': "LGPL-3",
'installable': True,
'auto_install': False,
'application': False
}

22
odoo_google_contact_integration/controllers/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Haseen (<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import google_contact_integration

73
odoo_google_contact_integration/controllers/google_contact_integration.py

@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Haseen(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
import datetime
import requests
from odoo import _
from odoo import http
from odoo.http import request
from odoo.exceptions import UserError
TIMEOUT = 20
class GoogleContactAuth(http.Controller):
"""Controller for Google Contact authentication. """
@http.route('/google_contact_authentication', type="http", auth="public",
website=True)
def get_auth_code(self, **kw):
"""Connect your Google account with the OAuth Authentication process.
You will be redirected to the Google login page
where you will need to accept the permission."""
user_id = request.uid
company_id = http.request.env['res.users'].sudo().search(
[('id', '=', user_id)], limit=1).company_id
if kw.get('code'):
company_id.write(
{'contact_company_authorization_code': kw.get('code')})
data = {
'code': kw.get('code'),
'client_id': company_id.contact_client_id,
'client_secret': company_id.contact_client_secret,
'redirect_uri': company_id.contact_redirect_uri,
'grant_type': 'authorization_code'
}
response = requests.post(
'https://accounts.google.com/o/oauth2/token', data=data,
headers={
'content-type': 'application/x-www-form-urlencoded'},
timeout=TIMEOUT)
if response.json() and response.json().get('access_token'):
company_id.write({
'contact_company_access_token':
response.json().get('access_token'),
'contact_company_access_token_expiry':
datetime.datetime.now() + datetime.timedelta(
seconds=response.json().get('expires_in')),
'contact_company_refresh_token':
response.json().get('access_token'),
})
return "Authentication Success. You Can Close this window"
else:
raise UserError(
_('Something went wrong during the token generation.'
'Maybe your Authorization Code is invalid')
)

6
odoo_google_contact_integration/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <odoo_google_contact_integration>
#### 30.04.2024
#### Version 15.0.1.0.0
#### ADD
- Initial commit for Google Contact Connector

23
odoo_google_contact_integration/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Haseen (<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import res_partner
from . import res_company

177
odoo_google_contact_integration/models/res_company.py

@ -0,0 +1,177 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Haseen(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import logging
import requests
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.http import request
_logger = logging.getLogger(__name__)
TIMEOUT = 20
class ResCompany(models.Model):
"""Inherit res_company for integrating contacts with Google"""
_inherit = "res.company"
contact_client_id = fields.Char(
string="Client Id", help='People API Client ID')
contact_client_secret = fields.Char(
string="Client Secret", help='People API Client Secret')
contact_redirect_uri = fields.Char(
string="Authorized redirect URIs",
compute="_compute_contact_redirect_uri",
help='People API Authorized redirect URIs')
contact_company_access_token = fields.Char(
string="Access Token", copy=False,
help='People API Access Token')
contact_company_access_token_expiry = fields.Datetime(
string="Token expiry", help='People API Token Expiry')
contact_company_refresh_token = fields.Char(
string="Refresh Token", copy=False, help='People API Refresh Token')
contact_company_authorization_code = fields.Char(
string="Authorization Code", help='People API Authorization Code')
@api.depends('contact_redirect_uri')
def _compute_contact_redirect_uri(self):
"""Compute the redirect URI for onedrive and Google Drive"""
for rec in self:
base_url = request.env['ir.config_parameter'].get_param(
'web.base.url')
rec.contact_redirect_uri = base_url + '/google_contact_authentication'
def action_google_contact_authenticate(self):
"""Authenticate the connection to Google."""
if not self.contact_client_id:
raise ValidationError("Please Enter Client ID")
if not self.contact_redirect_uri:
raise ValidationError("Please Enter Client Secret")
people_scope = 'https://www.googleapis.com/auth/contacts'
url = (
"https://accounts.google.com/o/oauth2/v2/auth?response_type=code"
"&access_type=offline&client_id={}&redirect_uri={}&scope={} "
).format(self.contact_client_id,
self.contact_redirect_uri, people_scope)
return {
"type": 'ir.actions.act_url',
"url": url,
"target": "new"
}
def action_google_contact_refresh_token(self):
"""Request a refresh token from Google."""
if not self.contact_client_id:
raise UserError(
_('Client ID is not yet configured.'))
if not self.contact_client_secret:
raise UserError(
_('Client Secret is not yet configured.'))
if not self.contact_company_refresh_token:
raise UserError(
_('Refresh Token is not yet configured.'))
data = {
'client_id': self.contact_client_id,
'client_secret': self.contact_client_secret,
'refresh_token': self.contact_company_refresh_token,
'grant_type': 'refresh_token',
}
response = requests.post(
'https://accounts.google.com/o/oauth2/token', data=data,
headers={
'content-type': 'application/x-www-form-urlencoded'},
timeout=TIMEOUT)
if response.json() and response.json().get('access_token'):
self.write({
'contact_company_access_token':
response.json().get('access_token'),
})
else:
raise UserError(
_('Something went wrong during the token generation.'
' Please request again an authorization code.')
)
def action_import_google_contacts(self):
"""IMPORT Contacts FROM Google TO ODOO"""
url = ("https://people.googleapis.com/v1/people/me/"
"connections?personFields=names,addresses,"
"emailAddresses,phoneNumbers&pageSize=1000")
headers = {
'Authorization': f'Bearer {self.contact_company_access_token}',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json().get('connections', [])
partners = []
for connection in data:
cnt_rsr_name = connection.get('resourceName', '')
etag = connection.get('etag', '')
names = connection.get('names', [{}])[0]
first_name = names.get('givenName', '')
last_name = names.get('familyName', '')
name = names.get('displayName', '')
emailAddresses = connection.get('emailAddresses', [{}])[0]
email = emailAddresses.get('value', '')
phoneNumbers = connection.get('phoneNumbers', [{}])[0]
phone = phoneNumbers.get('value', '')
addresses = connection.get('addresses', [{}])[0]
street = addresses.get('streetAddress', '')
street2 = addresses.get('extendedAddress', '')
city = addresses.get('city', '')
pin = addresses.get('postalCode', '')
state = addresses.get('region', '')
state = self.env['res.country.state'].search(
[("name", 'ilike', state)], limit=1)
state_id = state.id if state else False
country_code = addresses.get('countryCode', '')
country = self.env['res.country'].search(
[('code', 'ilike', country_code)], limit=1)
country_id = country.id if country else False
partner_vals = {
'name': name or '',
'first_name': first_name or '',
'last_name': last_name or '',
'email': email or '',
'street': street or '',
'street2': street2 or '',
'city': city or '',
'zip': pin or '',
'state_id': state_id or False,
'country_id': country_id or False,
'phone': phone,
'google_resource': cnt_rsr_name,
'google_etag': etag,
}
existing_partner = self.env['res.partner'].search(
[('google_resource', '=', cnt_rsr_name)], limit=1)
if existing_partner:
existing_partner.write(partner_vals)
else:
partners.append(partner_vals)
if partners:
self.env['res.partner'].create(partners)
_logger.info("Contact imported successfully!")
else:
error_message = f"Failed to import contact. Error: {response.text}"
raise ValidationError(error_message)

162
odoo_google_contact_integration/models/res_partner.py

@ -0,0 +1,162 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jumana Haseen (<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
import logging
import requests
from odoo import fields, models, _
from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__)
TIMEOUT = 20
class ResPartner(models.Model):
"""Inherit res_partner for integrating contacts with Google"""
_inherit = 'res.partner'
google_resource = fields.Char('Google Contact Id',
help='Contact Unique identifier', readonly=True)
google_etag = fields.Char(
'Google Etag', help='Contact Version control key', readonly=True)
first_name = fields.Char(
'First Name', help='Enter the first name of the person.')
last_name = fields.Char(
'Last Name', help='Enter the last name of the person.')
def action_export_google_contacts(self):
"""Export Contacts FROM Google TO ODOO"""
current_uid = self._context.get('uid')
user_id = self.env['res.users'].browse(current_uid)
company_id = user_id.company_id
partner_ids = self.env['res.partner'].sudo().browse(
self.env.context.get('active_ids'))
for partner in partner_ids:
header = {
'Authorization':
f'Bearer {company_id.contact_company_access_token}',
'Content-Type': 'application/json'
}
contact_payload = {
'names': [
{
'givenName': partner.first_name or partner.name,
'familyName': partner.last_name or ''
}
],
'emailAddresses': [
{
'value': partner.email or '',
'type': 'work'
}
],
'phoneNumbers': [
{
'value': partner.phone or '',
'type': 'work'
}
],
'addresses': [
{
'streetAddress': partner.street or '',
'city': partner.city or '',
'region': partner.state_id.name or '',
'postalCode': partner.zip or '',
'country': partner.country_id.name or '',
'type': 'work'
}
],
'organizations': [
{
'name': partner.company_id.name or '',
'title': partner.title or '',
'type': 'work'
}
]
}
if partner.google_etag:
contact_resource_name = partner.google_resource
contact_payload['resourceName'] = contact_resource_name
contact_payload['etag'] = partner.google_etag
url = (
f"https://people.googleapis.com/v1/{contact_resource_name}:updateContact?"
"updatePersonFields=emailAddresses,names,phoneNumbers,"
"addresses,organizations,userDefined&"
"prettyPrint=false"
)
response = requests.patch(url, headers=header,
json=contact_payload)
if response.status_code == 200:
partner.write({
'google_resource': response.json().get('resourceName'),
'google_etag': response.json().get('etag')
})
_logger.info("Contact updated successfully!")
else:
error_message = f"Failed to update contact. Error: {response.text}"
raise ValidationError(error_message)
else:
url = 'https://people.googleapis.com/v1/people:createContact'
result = requests.post(url, headers=header,
json=contact_payload)
if result.status_code == 200:
partner.write({
'google_resource': result.json().get('resourceName'),
'google_etag': result.json().get('etag')
})
_logger.info("Contact exported successfully!")
else:
error_message = f"Failed to export contact. Error: {result.text}"
raise ValidationError(error_message)
def action_delete_google_contact(self):
"""Deleting a contact from Google Contacts"""
current_uid = self._context.get('uid')
user_id = self.env['res.users'].browse(current_uid)
company_id = user_id.company_id
partner_ids = self.env['res.partner'].sudo().browse(
self.env.context.get('active_ids'))
for partner in partner_ids:
contact_resource_name = partner.google_resource
if not contact_resource_name:
_logger.warning(
"Partner %s does not have a Google contact resource name.",
partner.name)
continue
url = f"https://people.googleapis.com/v1/{contact_resource_name}:deleteContact"
headers = {
'Authorization': f'Bearer {company_id.contact_company_access_token}',
'Content-Type': 'application/json'
}
response = requests.delete(url, headers=headers)
if response.status_code == 200:
_logger.info("Contact deleted successfully!")
partner.google_resource = ''
partner.google_etag = ''
partner.unlink()
elif response.status_code == 404:
_logger.warning(
"Contact not found in Google. Removing local reference.")
partner.google_resource = ''
partner.google_etag = ''
else:
error_message = f"Failed to delete contact. Error: {response.text}"
raise ValidationError(error_message)

BIN
odoo_google_contact_integration/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
odoo_google_contact_integration/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
odoo_google_contact_integration/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
odoo_google_contact_integration/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
odoo_google_contact_integration/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
odoo_google_contact_integration/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
odoo_google_contact_integration/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
odoo_google_contact_integration/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
odoo_google_contact_integration/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
odoo_google_contact_integration/static/description/assets/icons/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
odoo_google_contact_integration/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
odoo_google_contact_integration/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
odoo_google_contact_integration/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
odoo_google_contact_integration/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
odoo_google_contact_integration/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
odoo_google_contact_integration/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
odoo_google_contact_integration/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
odoo_google_contact_integration/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
odoo_google_contact_integration/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
odoo_google_contact_integration/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
odoo_google_contact_integration/static/description/assets/modules/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
odoo_google_contact_integration/static/description/assets/modules/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
odoo_google_contact_integration/static/description/assets/modules/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
odoo_google_contact_integration/static/description/assets/modules/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
odoo_google_contact_integration/static/description/assets/modules/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
odoo_google_contact_integration/static/description/assets/modules/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/13.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/14.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/15.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/17.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/18.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/19.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/21.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/22.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
odoo_google_contact_integration/static/description/assets/screenshots/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 KiB

BIN
odoo_google_contact_integration/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
odoo_google_contact_integration/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

906
odoo_google_contact_integration/static/description/index.html

@ -0,0 +1,906 @@
<div class="container"
style="padding: 1rem !important; margin-bottom: 1rem !important;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
style="border-bottom: 1px solid #d5d5d5;">
<div class="my-3">
<img src="./assets/icons/logo.png"
style="width: auto !important; height: 40px !important;">
</div>
<div class="my-3 d-flex align-items-center">
<div
style="background-color: #7C7BAD !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Community
</div>
<div
style="background-color: #875A7B !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
<div
style="background-color: #1A5A7B !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Odoo.sh
</div>
</div>
</div>
</div>
</div>
<div class="container" style="padding: 0rem 1.5rem 4rem !important">
<div class="row" style="height: 900px !important;">
<div class="col-sm-12 col-md-12 col-lg-12"
style="padding: 4rem 1rem !important; background-color: #714B67 !important; height: 600px !important; border-radius: 20px !important;">
<h1
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #FFFFFF !important; font-size: 3.5rem !important; text-align: center !important;">
Google Contact Connector</h1>
<p
style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;">
A Module For Synchronizing Google Contacts.
</p>
<img src="./assets/screenshots/hero.gif" class="img-responsive"
width="100%" height="auto"/>
</div>
</div>
<div class="row">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin-bottom: 2rem !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-compass mr-2"></i>Explore this module
</h2>
</div>
<div class="col-md-6">
<a href="#overview" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Overview</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
Learn more about this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#configuration" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Configuration</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
View configurations for this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#features" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Features</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
View features of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#screenshots" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Screenshots</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
See key screenshots of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right"
style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
</div>
<div class="row" id="overview">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-pie-chart mr-2"></i>Overview
</h2>
</div>
<div class="col-mg-12 pl-3">
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
The Google Contact Connector module helps you import Google
contacts from Odoo and export Google contacts to Odoo.</p>
</div>
</div>
<div class="row" id="features">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-star mr-2"></i>Features
</h2>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Import Odoo contacts to Google.</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Update already created contacts when importing from Google
to Odoo.</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Delete contact from Odoo and Google.</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Export Google contacts to Odoo.</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Update already created contacts when exporting from Google
to Odoo.</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Filter contact synced with Google.</h4>
</div>
</div>
</div>
<!-- CONFIGURATION SECTION -->
<div class="row" id="configuration">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-pie-chart mr-2"></i>Configuration
</h2>
</div>
</div>
<div class="col-lg-12 my-2">
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
1. Steps to set up in Google.</h3>
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Sign in with your Google Account. To generate Google Contact API
credentials, go to Google API Platform.
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;(https://console.cloud.google.com/apis/dashboard)
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Click Enable APIs and Services.
</h3>
<img src="assets/screenshots/1.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h3 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
2. In the search bar, look for Google People API.</h3>
<img src="assets/screenshots/2.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h3 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
3. Select the Google People API and enable it.</h3>
<img src="assets/screenshots/3.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
4. Click Create Credentials.</h4>
<img src="assets/screenshots/4.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
5. Choose Google People API and the User Data. Then, click
Next.</h4>
<img src="assets/screenshots/5.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
6. Enter the app name and email address. Then, click Save and
Continue..</h4>
<img src="assets/screenshots/6.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
7. Skipped the Third Scope. Save and Continue.</h4>
<img src="assets/screenshots/7.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
8. Choose Website application and then type the name of the
app.</h4>
<img src="assets/screenshots/8.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
9. In the Authorized JavaScript Origins section, add your company's
URL. And in the Authorized redirect URIs section, add your company's
URL followed by /google_contact_authentication.</h4>
<img src="assets/screenshots/9.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
10. After successfully generating Google People API credentials, you
will receive a Client ID and Client Secret.</h4>
<img src="assets/screenshots/10.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
'<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
11. Here we can see the Client ID and Secret Key.</h4>
<img src="assets/screenshots/11.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
12. Also provide users to access the app.</h4>
<img src="assets/screenshots/12.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
</div>
<!--SCREENSHOTS-->
<div class="row" id="screenshots">
<div class="col-md-12"
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-image mr-2"></i>Screenshots
</h2>
</div>
<div class="col-lg-12 my-2">
<h4 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Odoo Configuration</h4>
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Go to Settings-> Companies
Then click on the company name and select the Google Contact tab.
Enter the Client id, Client secret and Redirect Url in Credentials.
<br/>
After entering all the details click on Authenticate.</h3>
<img src="assets/screenshots/13.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
After successful authentication, now you can sync Google Contacts
with Odoo.</h3>
<img src="assets/screenshots/14.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h1 class="mt-2"
style="text-align:center;font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Import Contact</h1>
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
In Google, Contacts.</h3>
<img src="assets/screenshots/15.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Go to Settings -> Companies -> Select the 'Google Contact' tab ->
Then, click the 'Import Contacts' button to import Google contacts
into Odoo.</h3>
<img src="assets/screenshots/16.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Contacts imported into Odoo.</h3>
<img src="assets/screenshots/17.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h1 class="mt-2"
style="text-align:center;font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Export Contact</h1>
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Select the contacts that need to be exported from Odoo to Google.
Then, click on the 'Export to Google' button.</h3>
<img src="assets/screenshots/18.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Exported contacts from Odoo to Google.</h3>
<img src="assets/screenshots/19.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h1 class="mt-2"
style="text-align:center;font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Delete Contact.</h1>
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Select the contacts that need to be deleted from both Google and
Odoo. Then, click on the 'Delete G-Contact' button. If that contact
is associated with another model, it will only be deleted from
Google.</h3>
<img src="assets/screenshots/20.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
From Google, the contact has been removed.</h3>
<img src="assets/screenshots/21.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<br/>
<div class="col-lg-12 my-3">
<h1 class="mt-2"
style="text-align:center;font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Filter Contact</h1>
<h3 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Click the Filter by 'G-contacts' option to filter the synchronized contacts.Contacts that synced with Google. can be seen</h3>
<img src="assets/screenshots/22.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
</div>
<!-- SUGGESTED PRODUCTS -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="color: #212529 !important;">Suggested Products</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/custom_gantt_view/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/1.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/hide_menu_user/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/2.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/whatsapp_redirect/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/3.png">
</div>
</a>
</div>
</div>
<div class="carousel-item" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/login_user_detail/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/4.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/all_in_one_dynamic_custom_fields/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/5.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16"
style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/web_login_styles/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/6.png">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev"
style="left:-25px;width: 35px;color: #000;"> <span
class="carousel-control-prev-icon"><i
class="fa fa-chevron-left"
style="font-size:24px"></i></span> </a> <a
class="carousel-control-next" href="#demo1" data-slide="next"
style="right:-25px;width: 35px;color: #000;">
<span class="carousel-control-next-icon"><i
class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</div>
</div>
<!-- END OF SUGGESTED PRODUCTS -->
<!-- OUR SERVICES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Services</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Customization</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Support</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire
Odoo
Developer</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Integration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Migration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Consultancy</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive"
height="48px" width="48px">
</div>
<h6 class="text-center"
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Licensing Consultancy</h6>
</div>
</div>
</section>
<!-- END OF END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Industries</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/trading-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure
and
sell your products</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/pos-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy
configuration
and convivial experience</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/education-black.png"
class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for
educational management</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/manufacturing-black.png"
class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and
schedule your operations</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/ecom-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile
friendly,
awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/service-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of
services and invoice</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/restaurant-black.png"
class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or
restaurant methodically</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/hotel-black.png"
class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An
all-inclusive
hotel management application</p>
</div>
</div>
</div>
</section>
<!-- END OF END OF OUR INDUSTRIES -->
<!-- FOOTER -->
<!-- Footer Section -->
<section class="container" style="margin: 5rem auto 2rem;">
<div class="row" style="max-width:1540px;">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Need Help?</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
</div>
</div>
<!-- Contact Cards -->
<div class="row d-flex justify-content-center align-items-center"
style="max-width:1540px; margin: 0 auto 2rem auto;">
<div class="col-lg-12"
style="padding: 0rem 3rem 2rem; border-radius: 10px; margin-right: 3rem; ">
<div class="row mt-4">
<div class="col-lg-6">
<a href="mailto:odoo@cybrosys.com" target="_blank"
class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #4d4d4d; color: #FFF; border-radius: 4px;"><i
class="fa fa-envelope mr-2"></i>odoo@cybrosys.com</a>
</div>
<div class="col-lg-6">
<a href="https://api.whatsapp.com/send?phone=918606827707"
target="_blank"
class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #25D366; color: #FFF; border-radius: 4px;"><i
class="fa fa-whatsapp mr-2"></i>+91 86068 27707</a>
</div>
</div>
</div>
</div>
<!-- End of Contact Cards -->
</section>
<!-- Footer -->
<section class="oe_container" style="padding: 2rem 3rem 1rem;">
<div class="row"
style="max-width:1540px; margin: 0 auto; margin-right: 3rem; ">
<!-- Logo -->
<div class="col-lg-12 d-flex justify-content-center align-items-center"
style="margin-top: 3rem;">
<img src="https://www.cybrosys.com/images/logo.png" width="200px"
height="auto"/>
</div>
<!-- End of Logo -->
<div class="col-lg-12">
<hr
style="margin-top: 3rem;background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;">
<!-- End of Footer Section -->
</div>
</div>
</section>
<!-- END OF FOOTER -->
</div>

55
odoo_google_contact_integration/views/res_company_views.xml

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--Inherit the Res Company form view -->
<record id="view_company_form" model="ir.ui.view">
<field name="name">
res.company.view.form.inherit.odoo.google.contact.integration
</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page[1]" position="after">
<page string="Google Contact">
<separator name="gci_configuration"
string="Google Contact Configuration"/>
<notebook>
<page name="gci_credentials" string="Credentials">
<group>
<field name="contact_client_id"/>
<field name="contact_client_secret"/>
<field name="contact_redirect_uri"/>
</group>
<group>
<button string="Authenticate" type="object"
name="action_google_contact_authenticate"
class="oe_highlight"
/>
<button string="Refresh Token" type="object"
name="action_google_contact_refresh_token"
class="oe_highlight"/>
</group>
</page>
<page name="gci_authentication" string="Authentication">
<group>
<field name="contact_company_access_token"/>
<field name="contact_company_access_token_expiry"/>
<field name="contact_company_refresh_token"/>
<field name="contact_company_authorization_code"/>
</group>
</page>
<page name="gci_export" string="Import">
<group>
<div style="width: 150px; height: 50px; font-size: 16px;">
<button string="Import Contacts"
type="object"
name="action_import_google_contacts"
/>
</div>
</group>
</page>
</notebook>
</page>
</xpath>
</field>
</record>
</odoo>

60
odoo_google_contact_integration/views/res_partner_views.xml

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--Inherit the Res Partner form view -->
<record id="view_partner_form" model="ir.ui.view">
<field name="name">
res.partner.view.form.inherit.odoo.google.contact.integration
</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//span[@name='address_name']" position="before">
<field name='first_name'/>
<field name="last_name"/>
</xpath>
<xpath expr="//field[@name='industry_id']" position="after">
<field name="google_resource"/>
<field name="google_etag"/>
</xpath>
</field>
</record>
<!-- Export G-Contact Button in action menu -->
<record id="action_export_google_contact" model="ir.actions.server">
<field name="name">Export to Google</field>
<field name="model_id" ref="model_res_partner"/>
<field name="binding_model_id" ref="model_res_partner"/>
<field name="binding_view_types">list,form</field>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_export_google_contacts()
</field>
</record>
<!--Inherit the Res Partner filter view -->
<record id="view_res_partner_filter" model="ir.ui.view">
<field name="name">
res.partner.view.search.inherit.odoo.google.contact.integration
</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='type_company']" position="after">
<separator/>
<filter string="G-Contacts" name="g_contacts"
domain="[('google_resource','!=', False)]"/>
</xpath>
</field>
</record>
<!-- Delete G-Contact Button in action menu -->
<record id="action_delete_google_contact" model="ir.actions.server">
<field name="name">Delete G-Contact</field>
<field name="model_id" ref="model_res_partner"/>
<field name="binding_model_id" ref="model_res_partner"/>
<field name="binding_view_types">list,form</field>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_delete_google_contact()
</field>
</record>
</odoo>
Loading…
Cancel
Save