diff --git a/odoo_google_contact_integration/README.rst b/odoo_google_contact_integration/README.rst new file mode 100644 index 000000000..6ece9706e --- /dev/null +++ b/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 `__ + +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: ``__ diff --git a/odoo_google_contact_integration/__init__.py b/odoo_google_contact_integration/__init__.py new file mode 100644 index 000000000..003d3838c --- /dev/null +++ b/odoo_google_contact_integration/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen() +# +# 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 . +# +############################################################################# +from . import controllers +from . import models diff --git a/odoo_google_contact_integration/__manifest__.py b/odoo_google_contact_integration/__manifest__.py new file mode 100644 index 000000000..bfa69154f --- /dev/null +++ b/odoo_google_contact_integration/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen () +# +# 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 . +# +############################################################################# +{ + '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 +} diff --git a/odoo_google_contact_integration/controllers/__init__.py b/odoo_google_contact_integration/controllers/__init__.py new file mode 100644 index 000000000..4b163cadd --- /dev/null +++ b/odoo_google_contact_integration/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen () +# +# 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 . +# +############################################################################# +from . import google_contact_integration diff --git a/odoo_google_contact_integration/controllers/google_contact_integration.py b/odoo_google_contact_integration/controllers/google_contact_integration.py new file mode 100644 index 000000000..9d279c61f --- /dev/null +++ b/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() +# Author: Jumana Haseen() +# +# 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 . +# +############################################################################# +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') + ) diff --git a/odoo_google_contact_integration/doc/RELEASE_NOTES.md b/odoo_google_contact_integration/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..0c4ac434d --- /dev/null +++ b/odoo_google_contact_integration/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 30.04.2024 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for Google Contact Connector diff --git a/odoo_google_contact_integration/models/__init__.py b/odoo_google_contact_integration/models/__init__.py new file mode 100644 index 000000000..444da28f0 --- /dev/null +++ b/odoo_google_contact_integration/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen () +# +# 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 . +# +############################################################################# +from . import res_partner +from . import res_company diff --git a/odoo_google_contact_integration/models/res_company.py b/odoo_google_contact_integration/models/res_company.py new file mode 100644 index 000000000..590c69b12 --- /dev/null +++ b/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() +# Author: Jumana Haseen() +# +# 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 . +# +############################################################################## +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) diff --git a/odoo_google_contact_integration/models/res_partner.py b/odoo_google_contact_integration/models/res_partner.py new file mode 100644 index 000000000..3c5a24013 --- /dev/null +++ b/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() +# Author: Jumana Haseen () +# +# 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 . +# +############################################################################# +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) diff --git a/odoo_google_contact_integration/static/description/assets/icons/check.png b/odoo_google_contact_integration/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/check.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/chevron.png b/odoo_google_contact_integration/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/chevron.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/cogs.png b/odoo_google_contact_integration/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/cogs.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/consultation.png b/odoo_google_contact_integration/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/consultation.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/ecom-black.png b/odoo_google_contact_integration/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/ecom-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/education-black.png b/odoo_google_contact_integration/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/education-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/hotel-black.png b/odoo_google_contact_integration/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/hotel-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/license.png b/odoo_google_contact_integration/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/license.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/lifebuoy.png b/odoo_google_contact_integration/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/lifebuoy.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/logo.png b/odoo_google_contact_integration/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/logo.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/manufacturing-black.png b/odoo_google_contact_integration/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/manufacturing-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/pos-black.png b/odoo_google_contact_integration/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/pos-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/puzzle.png b/odoo_google_contact_integration/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/puzzle.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/restaurant-black.png b/odoo_google_contact_integration/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/restaurant-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/service-black.png b/odoo_google_contact_integration/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/service-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/trading-black.png b/odoo_google_contact_integration/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/trading-black.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/training.png b/odoo_google_contact_integration/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/training.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/update.png b/odoo_google_contact_integration/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/update.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/user.png b/odoo_google_contact_integration/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/user.png differ diff --git a/odoo_google_contact_integration/static/description/assets/icons/wrench.png b/odoo_google_contact_integration/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/icons/wrench.png differ diff --git a/odoo_google_contact_integration/static/description/assets/modules/1.png b/odoo_google_contact_integration/static/description/assets/modules/1.png new file mode 100644 index 000000000..69be25c43 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/modules/1.png differ diff --git a/odoo_google_contact_integration/static/description/assets/modules/2.png b/odoo_google_contact_integration/static/description/assets/modules/2.png new file mode 100644 index 000000000..a5968b585 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/modules/2.png differ diff --git a/odoo_google_contact_integration/static/description/assets/modules/3.png b/odoo_google_contact_integration/static/description/assets/modules/3.png new file mode 100644 index 000000000..dad367fea Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/modules/3.png differ diff --git a/odoo_google_contact_integration/static/description/assets/modules/4.png b/odoo_google_contact_integration/static/description/assets/modules/4.png new file mode 100644 index 000000000..7dab7349d Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/modules/4.png differ diff --git a/odoo_google_contact_integration/static/description/assets/modules/5.png b/odoo_google_contact_integration/static/description/assets/modules/5.png new file mode 100644 index 000000000..87599e636 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/modules/5.png differ diff --git a/odoo_google_contact_integration/static/description/assets/modules/6.png b/odoo_google_contact_integration/static/description/assets/modules/6.png new file mode 100644 index 000000000..ff64f2f01 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/modules/6.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/1.png b/odoo_google_contact_integration/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..e5f733605 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/1.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/10.png b/odoo_google_contact_integration/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..f6b7152ed Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/10.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/11.png b/odoo_google_contact_integration/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..e37b7087f Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/11.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/12.png b/odoo_google_contact_integration/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..cf7af7563 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/12.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/13.png b/odoo_google_contact_integration/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..b691f021f Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/13.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/14.png b/odoo_google_contact_integration/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..daa8a41cc Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/14.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/15.png b/odoo_google_contact_integration/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..2bed4609e Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/15.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/16.png b/odoo_google_contact_integration/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..39fb42438 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/16.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/17.png b/odoo_google_contact_integration/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..aefa2a4e7 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/17.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/18.png b/odoo_google_contact_integration/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..cd2efb613 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/18.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/19.png b/odoo_google_contact_integration/static/description/assets/screenshots/19.png new file mode 100644 index 000000000..91487714e Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/19.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/2.png b/odoo_google_contact_integration/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..17db96e0b Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/2.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/20.png b/odoo_google_contact_integration/static/description/assets/screenshots/20.png new file mode 100644 index 000000000..9ba7e51ab Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/20.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/21.png b/odoo_google_contact_integration/static/description/assets/screenshots/21.png new file mode 100644 index 000000000..752e704e3 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/21.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/22.png b/odoo_google_contact_integration/static/description/assets/screenshots/22.png new file mode 100644 index 000000000..61439c689 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/22.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/3.png b/odoo_google_contact_integration/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..5542b2a19 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/3.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/4.png b/odoo_google_contact_integration/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..b4df78ab1 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/4.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/5.png b/odoo_google_contact_integration/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..34fa7bbd3 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/5.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/6.png b/odoo_google_contact_integration/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..0ecbd8497 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/6.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/7.png b/odoo_google_contact_integration/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..8d17bd5c8 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/7.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/8.png b/odoo_google_contact_integration/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..0ef6e3d80 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/8.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/9.png b/odoo_google_contact_integration/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..a35f6ec79 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/9.png differ diff --git a/odoo_google_contact_integration/static/description/assets/screenshots/hero.gif b/odoo_google_contact_integration/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..ee8c58198 Binary files /dev/null and b/odoo_google_contact_integration/static/description/assets/screenshots/hero.gif differ diff --git a/odoo_google_contact_integration/static/description/banner.jpg b/odoo_google_contact_integration/static/description/banner.jpg new file mode 100644 index 000000000..56d98aeb2 Binary files /dev/null and b/odoo_google_contact_integration/static/description/banner.jpg differ diff --git a/odoo_google_contact_integration/static/description/icon.png b/odoo_google_contact_integration/static/description/icon.png new file mode 100644 index 000000000..4e7d86b24 Binary files /dev/null and b/odoo_google_contact_integration/static/description/icon.png differ diff --git a/odoo_google_contact_integration/static/description/index.html b/odoo_google_contact_integration/static/description/index.html new file mode 100644 index 000000000..73162aa45 --- /dev/null +++ b/odoo_google_contact_integration/static/description/index.html @@ -0,0 +1,906 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+ +
+
+
+

+ Google Contact Connector

+

+ A Module For Synchronizing Google Contacts. +

+ +
+
+ + + + +
+
+

+ Overview +

+
+
+

+ The Google Contact Connector module helps you import Google + contacts from Odoo and export Google contacts to Odoo.

+
+
+
+
+

+ Features +

+
+
+
+ +
+
+

+ Import Odoo contacts to Google.

+
+
+
+
+ +
+
+

+ Update already created contacts when importing from Google + to Odoo.

+
+
+ +
+
+ +
+
+

+ Delete contact from Odoo and Google.

+
+
+
+
+ +
+
+

+ Export Google contacts to Odoo.

+
+
+ +
+
+ +
+
+

+ Update already created contacts when exporting from Google + to Odoo.

+
+
+
+
+ +
+
+

+ Filter contact synced with Google.

+
+
+ + +
+ + + +
+
+

+ Configuration +

+
+
+
+

+ 1. Steps to set up in Google.

+

+ Sign in with your Google Account. To generate Google Contact API + credentials, go to Google API Platform. +
+     (https://console.cloud.google.com/apis/dashboard) +
+     Click Enable APIs and Services. +

+ +
+
+
+

+ 2. In the search bar, look for Google People API.

+ +
+
+
+

+ 3. Select the Google People API and enable it.

+ +
+
+
+

+ 4. Click Create Credentials.

+ +
+
+
+

+ 5. Choose Google People API and the User Data. Then, click + Next.

+ +
+
+
+

+ 6. Enter the app name and email address. Then, click Save and + Continue..

+ +
+
+
+

+ 7. Skipped the Third Scope. Save and Continue.

+ +
+
+
+

+ 8. Choose Website application and then type the name of the + app.

+ +
+
+
+

+ 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.

+ +
+
+
+

+ 10. After successfully generating Google People API credentials, you + will receive a Client ID and Client Secret.

+ +
+ '
+
+

+ 11. Here we can see the Client ID and Secret Key.

+ +
+
+
+

+ 12. Also provide users to access the app.

+ +
+
+ +
+
+

+ Screenshots +

+
+ +
+

+ Odoo Configuration

+

+ 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. +
+ After entering all the details click on Authenticate.

+ +
+
+
+

+ After successful authentication, now you can sync Google Contacts + with Odoo.

+ +
+
+
+

+ Import Contact

+

+ In Google, Contacts.

+ +
+
+
+

+ Go to Settings -> Companies -> Select the 'Google Contact' tab -> + Then, click the 'Import Contacts' button to import Google contacts + into Odoo.

+ +
+
+
+

+ Contacts imported into Odoo.

+ +
+
+
+

+ Export Contact

+

+ Select the contacts that need to be exported from Odoo to Google. + Then, click on the 'Export to Google' button.

+ +
+
+
+

+ Exported contacts from Odoo to Google.

+ +
+
+
+

+ Delete Contact.

+

+ 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.

+ +
+
+
+

+ From Google, the contact has been removed.

+ +
+
+
+

+ Filter Contact

+

+ Click the Filter by 'G-contacts' option to filter the synchronized contacts.Contacts that synced with Google. can be seen

+ +
+
+ + + +
+
+

Suggested Products

+
+ +
+
+ + + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+ +
+
+ + + + + +
+
+
+

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/odoo_google_contact_integration/views/res_company_views.xml b/odoo_google_contact_integration/views/res_company_views.xml new file mode 100644 index 000000000..1ed57fac4 --- /dev/null +++ b/odoo_google_contact_integration/views/res_company_views.xml @@ -0,0 +1,55 @@ + + + + + + res.company.view.form.inherit.odoo.google.contact.integration + + res.company + + + + + + + + + + + + + +