diff --git a/onedrive_integration_odoo/__manifest__.py b/onedrive_integration_odoo/__manifest__.py index 0f84a9743..bfbc765c2 100644 --- a/onedrive_integration_odoo/__manifest__.py +++ b/onedrive_integration_odoo/__manifest__.py @@ -20,11 +20,12 @@ # ############################################################################### { - 'name': "OneDrive Integration", + 'name': "Onedrive Integration", 'version': "16.0.1.0.0'", 'category': "Document Management", - 'summary': """Sync Files between OneDrive and Odoo""", - 'description': """Sync Files between OneDrive and Odoo""", + 'summary': """Upload and download files in Onedrive using odoo """, + 'description': """This module was developed to upload files to Onedrive as + well as access files from Onedrive in Odoo.""", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/onedrive_integration_odoo/doc/RELEASE_NOTES.md b/onedrive_integration_odoo/doc/RELEASE_NOTES.md index 38e3604d0..5c96ccdd6 100644 --- a/onedrive_integration_odoo/doc/RELEASE_NOTES.md +++ b/onedrive_integration_odoo/doc/RELEASE_NOTES.md @@ -3,3 +3,8 @@ #### Version 16.0.1.0.0 #### ADD - Initial commit for Onedrive Integration + +#### 26.08.2024 +#### Version 16.0.1.0.1 +#### UPDT +- Added modules field and changed view diff --git a/onedrive_integration_odoo/models/res_config_settings.py b/onedrive_integration_odoo/models/res_config_settings.py index 254e9d13d..55eb19b72 100644 --- a/onedrive_integration_odoo/models/res_config_settings.py +++ b/onedrive_integration_odoo/models/res_config_settings.py @@ -20,12 +20,15 @@ # ############################################################################### import json +import logging import requests from werkzeug import urls from odoo import fields, models, _ from odoo.exceptions import UserError from odoo.http import request +_logger = logging.getLogger(__name__) + class ResConfigSettings(models.TransientModel): """ @@ -47,6 +50,10 @@ class ResConfigSettings(models.TransientModel): onedrive_access_token = fields.Char( string='Onedrive Access Token', help="Access Token for authenticating with OneDrive API") + onedrive_tenant_id = fields.Char( + string="Onedrive Tenant Id", + config_parameter='onedrive_integration_odoo.tenant_id', + help="Director (tenant) id for accessing OneDrive API") onedrive_refresh_token = fields.Char( string='Onedrive Refresh Token', help="Refresh Token for refreshing the access token") @@ -72,12 +79,16 @@ class ResConfigSettings(models.TransientModel): 'redirect_uri': request.env['ir.config_parameter'].get_param( 'web.base.url') + '/onedrive/authentication' } + tenant_id = self.env['ir.config_parameter'].get_param( + 'onedrive_integration_odoo.tenant_id', '') + res = requests.post( - "https://login.microsoftonline.com/common/oauth2/v2.0/token", + f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token", data=data, headers={"content-type": "application/x-www-form-urlencoded"}) response = res.content and res.json() or {} if 'error' in response: + _logger.warning(response) raise UserError(_("Error '%s': Please check the credentials.", response['error'])) else: diff --git a/onedrive_integration_odoo/static/description/assets/screenshots/06.png b/onedrive_integration_odoo/static/description/assets/screenshots/06.png new file mode 100644 index 000000000..5d60ab497 Binary files /dev/null and b/onedrive_integration_odoo/static/description/assets/screenshots/06.png differ diff --git a/onedrive_integration_odoo/static/description/assets/screenshots/2.png b/onedrive_integration_odoo/static/description/assets/screenshots/2.png index b5381dc4e..75ce33d9b 100644 Binary files a/onedrive_integration_odoo/static/description/assets/screenshots/2.png and b/onedrive_integration_odoo/static/description/assets/screenshots/2.png differ diff --git a/onedrive_integration_odoo/static/description/index.html b/onedrive_integration_odoo/static/description/index.html index 4c5f6028c..85933823b 100644 --- a/onedrive_integration_odoo/static/description/index.html +++ b/onedrive_integration_odoo/static/description/index.html @@ -205,7 +205,7 @@
Token setup is available in configuration settings. Setup Tokens button will redirect to an authorization page. Goto --> Settngs-->Integrations
-