@ -0,0 +1,51 @@ |
|||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Onedrive Integration |
|||
==================== |
|||
Onedrive Integration provides seamless integration with OneDrive, allowing users |
|||
to conveniently access their uploaded files from within the Odoo platform. With |
|||
this integration, users can easily view, upload and download files stored in |
|||
their OneDrive accounts, all from within their Odoo environment. |
|||
|
|||
Configuration |
|||
============= |
|||
The user should create onedrive client id, client secret from microsoft azure |
|||
with scope 'offline_access, openid, Files.ReadWrite.All' to get access token. |
|||
Folder id is the id on onedrive folder url |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (AGPL v3). |
|||
(http://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
* Developer: (v16) Aslam A K, 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>`__ |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import controllers |
|||
from . import models |
|||
from . import wizard |
|||
from .hooks import uninstall_hook |
@ -0,0 +1,52 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
{ |
|||
'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""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['base_setup'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'wizard/upload_file_views.xml', |
|||
'views/onedrive_dashboard_views.xml', |
|||
'views/res_config_settings_views.xml', |
|||
], |
|||
'assets': { |
|||
'web.assets_backend': [ |
|||
'/onedrive_integration_odoo/static/src/js/onedrive.js', |
|||
'/onedrive_integration_odoo/static/src/scss/onedrive.scss', |
|||
'/onedrive_integration_odoo/static/src/xml/onedrive_dashboard.xml' |
|||
] |
|||
}, |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': True, |
|||
'uninstall_hook': 'uninstall_hook', |
|||
} |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import onedrive_integration_odoo |
@ -0,0 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
import json |
|||
from odoo import http |
|||
from odoo.http import request |
|||
|
|||
|
|||
class OnedriveAuth(http.Controller): |
|||
""" |
|||
Return URL |
|||
""" |
|||
|
|||
@http.route('/onedrive/authentication', type='http', auth="public") |
|||
def oauth2callback(self, **kw): |
|||
""" |
|||
Return URL |
|||
""" |
|||
state = json.loads(kw['state']) |
|||
onedrive_config_id = request.env['onedrive.dashboard'].sudo().browse( |
|||
state.get('onedrive_config_id')) |
|||
onedrive_config_id.get_tokens(kw.get('code')) |
|||
return request.redirect(state.get('url_return')) |
@ -0,0 +1,5 @@ |
|||
## Module <onedrive_integration_odoo> |
|||
#### 11.12.2023 |
|||
#### Version 16.0.1.0.0 |
|||
#### ADD |
|||
- Initial commit for Onedrive Integration |
@ -0,0 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import SUPERUSER_ID, api |
|||
|
|||
|
|||
def uninstall_hook(cr, registry): |
|||
""" |
|||
Delete System Parameters |
|||
""" |
|||
env = api.Environment(cr, SUPERUSER_ID, {}) |
|||
env['ir.config_parameter'].sudo().search( |
|||
[('key', '=', 'onedrive_integration_odoo.client_id')]).unlink() |
|||
env['ir.config_parameter'].sudo().search( |
|||
[('key', '=', 'onedrive_integration_odoo.client_secret')]).unlink() |
|||
env['ir.config_parameter'].sudo().search( |
|||
[('key', '=', 'onedrive_integration_odoo.folder_id')]).unlink() |
|||
env['ir.config_parameter'].sudo().search( |
|||
[('key', '=', 'onedrive_integration_odoo.onedrive_button')]).unlink() |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import onedrive_dashboard |
|||
from . import res_config_settings |
@ -0,0 +1,150 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
import json |
|||
import logging |
|||
import requests |
|||
from datetime import timedelta |
|||
from odoo import fields, models |
|||
from odoo.http import request |
|||
|
|||
_logger = logging.getLogger(__name__) |
|||
|
|||
|
|||
class OneDriveDashboard(models.Model): |
|||
""" |
|||
Generate refresh and access token |
|||
""" |
|||
_name = 'onedrive.dashboard' |
|||
_description = "Generate access and refresh tokens " |
|||
|
|||
onedrive_access_token = fields.Char( |
|||
string="OneDrive Access Token", |
|||
store=True, |
|||
help="Access token for authenticating and accessing OneDrive APIs.") |
|||
onedrive_refresh_token = fields.Char( |
|||
string="OneDrive Refresh Token", |
|||
help="Refresh token for obtaining a new access token when the current " |
|||
"one expires.") |
|||
token_expiry_date = fields.Char( |
|||
string="OneDrive Token Validity", |
|||
help="Validity period of the access token, indicating until when it is" |
|||
" valid.") |
|||
upload_file = fields.Binary( |
|||
string="Upload File", |
|||
help="Binary field to store the uploaded file.") |
|||
|
|||
def get_tokens(self, authorize_code): |
|||
""" |
|||
Generate onedrive tokens from authorization code |
|||
""" |
|||
data = { |
|||
'code': authorize_code, |
|||
'client_id': self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.client_id', ''), |
|||
'client_secret': self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.client_secret', ''), |
|||
'grant_type': 'authorization_code', |
|||
'scope': ['offline_access openid Files.ReadWrite.All'], |
|||
'redirect_uri': request.env['ir.config_parameter'].get_param( |
|||
'web.base.url') + '/onedrive/authentication' |
|||
} |
|||
try: |
|||
res = requests.post( |
|||
"https://login.microsoftonline.com/common/oauth2/v2.0/token", |
|||
data=data, |
|||
headers={"content-type": "application/x-www-form-urlencoded"}) |
|||
res.raise_for_status() |
|||
response = res.content and res.json() or {} |
|||
if response: |
|||
expires_in = response.get('expires_in') |
|||
self.env['onedrive.dashboard'].create({ |
|||
'onedrive_access_token': response.get('access_token'), |
|||
'onedrive_refresh_token': response.get('refresh_token'), |
|||
'token_expiry_date': fields.Datetime.now() + timedelta( |
|||
seconds=expires_in) if expires_in else False, |
|||
}) |
|||
except requests.HTTPError as error: |
|||
_logger.exception("Bad microsoft onedrive request : %s !", |
|||
error.response.content) |
|||
raise error |
|||
|
|||
def generate_onedrive_refresh_token(self): |
|||
""" |
|||
Generate onedrive access token from refresh token if expired |
|||
""" |
|||
data = { |
|||
'client_id': self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.client_id', ''), |
|||
'client_secret': self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.client_secret', ''), |
|||
'scope': ['offline_access openid Files.ReadWrite.All'], |
|||
'grant_type': "refresh_token", |
|||
'redirect_uri': request.env['ir.config_parameter'].get_param( |
|||
'web.base.url') + '/onedrive/authentication', |
|||
'refresh_token': self.onedrive_refresh_token |
|||
} |
|||
try: |
|||
res = requests.post( |
|||
"https://login.microsoftonline.com/common/oauth2/v2.0/token", |
|||
data=data, |
|||
headers={"Content-type": "application/x-www-form-urlencoded"}) |
|||
res.raise_for_status() |
|||
response = res.content and res.json() or {} |
|||
if response: |
|||
expires_in = response.get('expires_in') |
|||
self.write({ |
|||
'onedrive_access_token': response.get('access_token'), |
|||
'onedrive_refresh_token': response.get('refresh_token'), |
|||
'token_expiry_date': fields.Datetime.now() + timedelta( |
|||
seconds=expires_in) if expires_in else False, |
|||
}) |
|||
except requests.HTTPError as error: |
|||
_logger.exception("Bad microsoft onedrive request : %s !", |
|||
error.response.content) |
|||
raise error |
|||
|
|||
def action_synchronize_onedrive(self): |
|||
""" |
|||
Pass the files to javascript |
|||
""" |
|||
record = self.search([], order='id desc', limit=1) |
|||
if not record: |
|||
return False |
|||
if record.token_expiry_date <= str(fields.Datetime.now()): |
|||
record.generate_onedrive_refresh_token() |
|||
folder = self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.folder_id', '') |
|||
if not folder: return False |
|||
url = "https://graph.microsoft.com/v1.0/me/drive/items/%s/children" \ |
|||
"?Content-Type=application/json" % folder |
|||
response = requests.request("GET", url, headers={ |
|||
'Authorization': 'Bearer "' + record.onedrive_access_token + '"'}, |
|||
data={}) |
|||
message = json.loads(response.content) |
|||
if 'error' in message: |
|||
return ['error', message['error']['code'], |
|||
message['error']['message']] |
|||
files = {} |
|||
for file in response.json().get('value'): |
|||
if list(file.keys())[0] == '@microsoft.graph.downloadUrl': |
|||
files[file['name']] = file['@microsoft.graph.downloadUrl'] |
|||
return files |
@ -0,0 +1,108 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
import json |
|||
import requests |
|||
from werkzeug import urls |
|||
from odoo import fields, models, _ |
|||
from odoo.exceptions import UserError |
|||
from odoo.http import request |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
""" |
|||
This model represents the configuration settings for the OneDrive |
|||
integration in Odoo.It allows users to configure various parameters for |
|||
OneDrive integration, including client ID, client secret, access token, |
|||
and folder ID. |
|||
""" |
|||
_inherit = 'res.config.settings' |
|||
|
|||
onedrive_client = fields.Char( |
|||
string='Onedrive Client ID', copy=False, |
|||
config_parameter='onedrive_integration_odoo.client_id', |
|||
help="Client ID for accessing OneDrive API") |
|||
onedrive_client_secret = fields.Char( |
|||
string='Onedrive Client Secret', |
|||
config_parameter='onedrive_integration_odoo.client_secret', |
|||
help="Client Secret for accessing OneDrive API") |
|||
onedrive_access_token = fields.Char( |
|||
string='Onedrive Access Token', |
|||
help="Access Token for authenticating with OneDrive API") |
|||
onedrive_refresh_token = fields.Char( |
|||
string='Onedrive Refresh Token', |
|||
help="Refresh Token for refreshing the access token") |
|||
onedrive_folder = fields.Char( |
|||
string='Folder ID', help="ID of the folder in OneDrive", |
|||
config_parameter='onedrive_integration_odoo.folder_id') |
|||
is_onedrive_enabled = fields.Boolean( |
|||
string="Synchronize Onedrive with odoo", |
|||
config_parameter='onedrive_integration_odoo.onedrive_button', |
|||
help="Enable/Disable OneDrive integration") |
|||
|
|||
def action_get_onedrive_auth_code(self): |
|||
""" |
|||
Generate onedrive authorization code |
|||
""" |
|||
data = { |
|||
'client_id': self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.client_id', ''), |
|||
'client_secret': self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.client_secret', ''), |
|||
'grant_type': 'client_credentials', |
|||
'scope': "https://graph.microsoft.com/.default", |
|||
'redirect_uri': request.env['ir.config_parameter'].get_param( |
|||
'web.base.url') + '/onedrive/authentication' |
|||
} |
|||
res = requests.post( |
|||
"https://login.microsoftonline.com/common/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: |
|||
raise UserError(_("Error '%s': Please check the credentials.", |
|||
response['error'])) |
|||
else: |
|||
authority = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize' |
|||
action = self.env["ir.actions.client"].sudo()._for_xml_id( |
|||
"onedrive_integration_odoo.onedrive_dashboard_action") |
|||
base_url = request.env['ir.config_parameter'].get_param( |
|||
'web.base.url') |
|||
url_return = base_url + '/web#id=%d&action=%d&view_type=form&model=%s' \ |
|||
% (self.id, action['id'], 'onedrive.dashboard') |
|||
encoded_params = urls.url_encode({ |
|||
'response_type': 'code', |
|||
'client_id': self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.client_id', ''), |
|||
'state': json.dumps({ |
|||
'onedrive_config_id': self.id, |
|||
'url_return': url_return |
|||
}), |
|||
'scope': ['offline_access openid Files.ReadWrite.All'], |
|||
'redirect_uri': base_url + '/onedrive/authentication', |
|||
'prompt': 'consent', |
|||
'access_type': 'offline' |
|||
}) |
|||
return { |
|||
'type': 'ir.actions.act_url', |
|||
'target': 'self', |
|||
'url': "%s?%s" % (authority, encoded_params), |
|||
} |
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 284 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 502 KiB |
After Width: | Height: | Size: 265 KiB |
After Width: | Height: | Size: 173 KiB |
After Width: | Height: | Size: 179 KiB |
After Width: | Height: | Size: 315 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 453 KiB |
After Width: | Height: | Size: 555 KiB |
After Width: | Height: | Size: 651 KiB |
After Width: | Height: | Size: 444 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,633 @@ |
|||
<div style="background-color: #714B67; min-height: 600px; width: 100%; padding: 15px; position: relative;"> |
|||
<!-- TITLE BAR --> |
|||
<div |
|||
style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;"> |
|||
<img src="/assets/misc/cybrosys-logo.png" width="42" height="42" style="width: 42px; height: 42px;" /> |
|||
<div> |
|||
<div style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" |
|||
class="mr-2"> |
|||
<i class="fa fa-check mr-1"></i>Community |
|||
</div> |
|||
<div style="color: #875A7B; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" |
|||
class="mr-2"> |
|||
<i class="fa fa-check mr-1"></i>Enterprise |
|||
</div> |
|||
<div style="color: #017E84; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" |
|||
class="mr-2"> |
|||
<i class="fa fa-check mr-1"></i>Odoo.sh |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- END OF TITLE BAR --> |
|||
|
|||
<!-- APP HERO --> |
|||
<h1 style="color: #FFFFFF; font-weight: bolder; font-size: 50px; text-align: center; margin-top: 50px;">Onedrive Integration</h1> |
|||
<p style="color:#FFFFFF; padding: 8px 15px; text-align: center; font-size: 24px;">Onedrive Integration allows to upload and download the files in Microsoft OneDrive. |
|||
</p> |
|||
<!-- END OF APP HERO --> |
|||
<img src="assets/screenshots/hero.gif" |
|||
style="width: 75%; height: auto; position: absolute; margin-left: auto; margin-right: auto; top: 45%; left: 12%; right: auto;" /> |
|||
|
|||
</div> |
|||
|
|||
<!-- NAVIGATION SECTION --> |
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="/assets/misc/compass.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Explore This |
|||
Module</h2> |
|||
</div> |
|||
<div class="row my-4" style="font-family: 'Montserrat', sans-serif;"> |
|||
<div class="col-sm-12 col-md-6 my-3"> |
|||
<a href="#overview"> |
|||
<div class="d-flex justify-content-between align-items-center" |
|||
style="background-color: #f5f5f5; padding: 30px; width: 100%;"> |
|||
<div> |
|||
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Overview</span> |
|||
<span |
|||
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">Learn |
|||
more about this |
|||
module</span> |
|||
</div> |
|||
<img src="/assets/misc/right-arrow.png" width="36" height="36" /> |
|||
</div> |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 col-md-6 my-3"> |
|||
<a href="#features"> |
|||
<div class="d-flex justify-content-between align-items-center" |
|||
style="background-color: #f5f5f5; padding: 30px; width: 100%;"> |
|||
<div> |
|||
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Features</span> |
|||
<span |
|||
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View |
|||
features of this |
|||
module</span> |
|||
</div> |
|||
<img src="/assets/misc/right-arrow.png" width="36" height="36" /> |
|||
</div> |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 col-md-6 my-3"> |
|||
<a href="#screenshots"> |
|||
<div class="d-flex justify-content-between align-items-center" |
|||
style="background-color: #f5f5f5; padding: 30px; width: 100%;"> |
|||
<div> |
|||
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Screenshots</span> |
|||
<span |
|||
style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View |
|||
screenshots for this |
|||
module</span> |
|||
</div> |
|||
<img src="/assets/misc/right-arrow.png" width="36" height="36" /> |
|||
</div> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
<!-- END OF NAVIGATION SECTION --> |
|||
|
|||
<!-- OVERVIEW SECTION --> |
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="overview"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="/assets/misc/pie-chart.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Overview |
|||
</h2> |
|||
</div> |
|||
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;"> |
|||
<div class="col-sm-12 py-4"> |
|||
OneDrive is a cloud-based file storage and sharing service from Microsoft. Integrating OneDrive with Odoo can provide users with a more convenient way to store and access their files within the Odoo platform. |
|||
</div> |
|||
</div> |
|||
<!-- END OF OVERVIEW SECTION --> |
|||
|
|||
<!-- FEATURES SECTION --> |
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="features"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="assets/misc/features.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Features |
|||
</h2> |
|||
</div> |
|||
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;"> |
|||
<div class="col-sm-12 col-md-6"> |
|||
<div class="d-flex align-items-center" style="margin-top: 40px; margin-bottom: 40px"> |
|||
<img src="assets/misc/check-box.png" class="mr-2" /> |
|||
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Easy File Management</span> |
|||
</div> |
|||
|
|||
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px"> |
|||
<img src="assets/misc/check-box.png" class="mr-2" /> |
|||
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Displays all files on Onedrive</span> |
|||
</div> |
|||
|
|||
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px"> |
|||
<img src="assets/misc/check-box.png" class="mr-2" /> |
|||
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Upload files to Onedrive</span> |
|||
</div> |
|||
|
|||
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px"> |
|||
<img src="assets/misc/check-box.png" class="mr-2" /> |
|||
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Filter files on basis of file type</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- END OF FEATURES SECTION --> |
|||
|
|||
<!-- SCREENSHOTS SECTION --> |
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="screenshots"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="assets/misc/pictures.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Screenshots |
|||
</h2> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-12"> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Onedrive api creation |
|||
</h3> |
|||
<p |
|||
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
To create Onedrive api register application on Microsoft Azure </p> |
|||
<img src="assets/screenshots/1.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Onedrive client id |
|||
</h3> |
|||
<p |
|||
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Registering on Microsoft Azure --> app registration will get client id and credentials </p> |
|||
<img src="assets/screenshots/2.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Onedrive client secret |
|||
</h3> |
|||
<p |
|||
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Client secret is available on client credentials option. it will be shown only once so, need to save it somewhere safe.</p> |
|||
<img src="assets/screenshots/3.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Onedrive Scopes |
|||
</h3> |
|||
<p |
|||
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Need to add scopes offline_access, openid, Files.ReadWrite.All to get refresh token and read write access</p> |
|||
<img src="assets/screenshots/4.png" class="img-thumbnail"> |
|||
</div> |
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Onedrive Folder id |
|||
</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
The Onedrive folder id is presented on url of that folder itself.</p> |
|||
<img src="assets/screenshots/5.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Token setup |
|||
</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Token setup is available in configuration settings. Setup Tokens button will redirect to an authorization page. |
|||
Goto --> Settngs-->Integrations</p> |
|||
<img src="assets/screenshots/6.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Login to microsoft to get auth code</p> |
|||
<img src="assets/screenshots/7.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
</p> |
|||
<img src="assets/screenshots/8.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Onedrive Integration view</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
</p> |
|||
<img src="assets/screenshots/9.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Filter View</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Example for excel filter |
|||
</p> |
|||
<img src="assets/screenshots/10.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Filter View</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Example for ZIP filter |
|||
</p> |
|||
<img src="assets/screenshots/11.png" class="img-thumbnail"> |
|||
</div> |
|||
|
|||
<div style="display: block; margin: 30px auto;"> |
|||
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> |
|||
Upload Files</h3> |
|||
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
|||
Wizard to upload files |
|||
</p> |
|||
<img src="assets/screenshots/12.png" class="img-thumbnail"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- END OF SCREENSHOTS SECTION --> |
|||
|
|||
<!-- RELATED PRODUCTS --> |
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="/assets/misc/categories.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Related |
|||
Products |
|||
</h2> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-12"> |
|||
<div id="demo1" class="row carousel slide" data-ride="carousel"> |
|||
<!-- The slideshow --> |
|||
<div class="carousel-inner" style="padding: 30px;"> |
|||
<div class="carousel-item" style="min-height: 198.656px;"> |
|||
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> |
|||
<a href="https://apps.odoo.com/apps/modules/16.0/auto_database_backup/" target="_blank"> |
|||
<div style="border-radius:10px"> |
|||
<img class="img img-responsive center-block" style="border-radius: 0px;" |
|||
src="assets/modules/1.gif"> |
|||
</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/16.0/crm_dashboard/" target="_blank"> |
|||
<div style="border-radius:10px"> |
|||
<img class="img img-responsive center-block" style="border-radius: 0px;" |
|||
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/16.0/hr_zk_attendance/" target="_blank"> |
|||
<div style="border-radius:10px"> |
|||
<img class="img img-responsive center-block" style="border-radius: 0px;" |
|||
src="assets/modules/3.png"> |
|||
</div> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
<div class="carousel-item active" style="min-height: 198.656px;"> |
|||
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left"> |
|||
<a href="https://apps.odoo.com/apps/modules/16.0/inventory_stock_dashboard_odoo/" target="_blank"> |
|||
<div style="border-radius:10px"> |
|||
<img class="img img-responsive center-block" style="border-radius: 0px;" |
|||
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/16.0/odoo_chatgpt_connector/" target="_blank"> |
|||
<div style="border-radius:10px"> |
|||
<img class="img img-responsive center-block" style="border-radius: 0px;" |
|||
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/16.0/whatsapp_mail_messaging/" target="_blank"> |
|||
<div style="border-radius:10px"> |
|||
<img class="img img-responsive center-block" style="border-radius: 0px;" |
|||
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="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="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 RELATED PRODUCTS --> |
|||
|
|||
<!-- OUR SERVICES --> |
|||
|
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="/assets/misc/star.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our Services |
|||
</h2> |
|||
</div> |
|||
|
|||
<div class="container my-5"> |
|||
<div class="row"> |
|||
<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> |
|||
|
|||
</div> |
|||
|
|||
<!-- END OF OUR SERVICES --> |
|||
<!-- OUR INDUSTRIES --> |
|||
|
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="/assets/misc/corporate.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our |
|||
Industries |
|||
</h2> |
|||
</div> |
|||
|
|||
<div class="container my-5"> |
|||
<div class="row"> |
|||
<div class="col-lg-3"> |
|||
<div class="my-4 d-flex flex-column justify-content-center" |
|||
style="background-color: #f6f8f9 !important; border-radius: 0px; 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: 0px; 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: 0px; 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: 0px; 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: 0px; 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 & 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: 0px; 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: 0px; 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: 0px; 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> |
|||
</div> |
|||
|
|||
<!-- END OF OUR INDUSTRIES --> |
|||
|
|||
<!-- SUPPORT --> |
|||
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;"> |
|||
<div class="d-flex justify-content-center align-items-center mr-2" |
|||
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> |
|||
<img src="/assets/misc/customer-support.png" /> |
|||
</div> |
|||
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Support |
|||
</h2> |
|||
</div> |
|||
<div class="container mt-5"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 col-md-6"> |
|||
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;"> |
|||
<div class="mr-4" |
|||
style="background-color: #714B67; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;"> |
|||
<img src="/assets/misc/support.png" height="48" width="48" style="width: 42px; height: 42px;" /> |
|||
</div> |
|||
<div> |
|||
<h4>Need Help?</h4> |
|||
<p style="line-height: 100%;">Got questions or need help? Get in touch.</p> |
|||
<a href="mailto:odoo@cybrosys.com"> |
|||
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;"> |
|||
odoo@cybrosys.com</p> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 col-md-6"> |
|||
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;"> |
|||
<div class="mr-4" |
|||
style="background-color: #2AC44D; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;"> |
|||
<img src="/assets/misc/whatsapp.png" height="52" width="52" style="width: 52px; height: 52px;" /> |
|||
</div> |
|||
<div> |
|||
<h4>WhatsApp</h4> |
|||
<p style="line-height: 100%;">Say hi to us on WhatsApp!</p> |
|||
<a href="https://api.whatsapp.com/send?phone=918606827707"> |
|||
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">+91 86068 |
|||
27707</p> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-12 my-5 d-flex justify-content-center align-items-center"> |
|||
<img src="/assets/misc/logo.png" width="144" height="31" |
|||
style="width:144px; height: 31px; margin-top: 40px;" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- END OF SUPPORT --> |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 609 B |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 38 KiB |
@ -0,0 +1,124 @@ |
|||
odoo.define('onedrive_integration_odoo.dashboard', function (require) { |
|||
'use strict'; |
|||
var AbstractAction = require('web.AbstractAction'); |
|||
var core = require('web.core'); |
|||
var rpc = require('web.rpc'); |
|||
|
|||
var OnedriveDashboard = AbstractAction.extend({ |
|||
template: 'OnedriveDashboard', |
|||
events: { |
|||
'click #import': 'synchronize', |
|||
'click #upload': 'upload', |
|||
'click .file-type': 'filter_file_type' |
|||
}, |
|||
|
|||
init() { |
|||
this._super(...arguments); |
|||
var self = this; |
|||
self.synchronize(); |
|||
}, |
|||
|
|||
/** |
|||
* Opens a file upload dialog on click of the "Upload" button. |
|||
* |
|||
* @param {Object} ev - The click event object. |
|||
*/ |
|||
upload: function (ev) { |
|||
this.do_action({ |
|||
name: "Upload File", |
|||
type: 'ir.actions.act_window', |
|||
res_model: 'upload.file', |
|||
view_mode: 'form', |
|||
view_type: 'form', |
|||
views: [[false, 'form']], |
|||
target: 'new', |
|||
}); |
|||
}, |
|||
|
|||
/** |
|||
* Retrieves and displays files from OneDrive on click of the "Import" button. |
|||
* |
|||
* @param {Object} ev - The click event object. |
|||
*/ |
|||
synchronize: function (ev) { |
|||
var self = this; |
|||
rpc.query({ |
|||
model: 'onedrive.dashboard', |
|||
method: 'action_synchronize_onedrive', |
|||
args: [''] |
|||
}).then(function (result) { |
|||
if (!result) { |
|||
// Display a notification if access tokens are not set up
|
|||
self.do_action({ |
|||
'type': 'ir.actions.client', |
|||
'tag': 'display_notification', |
|||
'params': { |
|||
'message': 'Please setup credentials', |
|||
'type': 'warning', |
|||
'sticky': false, |
|||
} |
|||
}); |
|||
} else if (result[0] === 'error') { |
|||
console.log(result); |
|||
if (result[1] === 'itemNotFound') { |
|||
// Display a notification if the folder is not found
|
|||
self.do_action({ |
|||
'type': 'ir.actions.client', |
|||
'tag': 'display_notification', |
|||
'params': { |
|||
'message': 'Error: Folder not found.', |
|||
'type': 'warning', |
|||
'sticky': false, |
|||
} |
|||
}); |
|||
} else { |
|||
// Display a notification for other errors
|
|||
self.do_action({ |
|||
'type': 'ir.actions.client', |
|||
'tag': 'display_notification', |
|||
'params': { |
|||
'message': 'Error:' + result[2], |
|||
'type': 'warning', |
|||
'sticky': false, |
|||
} |
|||
}); |
|||
} |
|||
} else { |
|||
// Empty the onedrive_files div and append the files retrieved
|
|||
self.$('#onedrive_files').empty(); |
|||
var alt_src = "'/onedrive_integration_odoo/static/src/img/file_icon.png'"; |
|||
$.each(Object.keys(result), function (index, name) { |
|||
self.$('#onedrive_files').append('<div class="col-sm-6 card" align="center"><a href="' + result[name] + '"><img class="card-img top" src="' + result[name] + '" onerror="this.src=' + alt_src + ';"/>' + name + '</div>'); |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
/** |
|||
* Filters files displayed based on file type (e.g., image, all files). |
|||
* |
|||
* @param {Object} ev - The click event object. |
|||
*/ |
|||
filter_file_type: function (ev) { |
|||
var value = ev.currentTarget.getAttribute('value'); |
|||
$.each(this.$('.card'), function (index, name) { |
|||
$(this).hide(); |
|||
var file_type = (name.textContent).slice(((name.textContent).lastIndexOf(".") - 1 >>> 0) + 2); |
|||
if (file_type == value) { |
|||
$(this).show(); |
|||
} |
|||
if (value == 'allfiles') { |
|||
$(this).show(); |
|||
} |
|||
if (value == 'image') { |
|||
if (file_type == 'jpeg' || file_type == 'jpg' || file_type == 'png') { |
|||
$(this).show(); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
}); |
|||
|
|||
core.action_registry.add("onedrive_dashboard", OnedriveDashboard); |
|||
return OnedriveDashboard; |
|||
}); |
@ -0,0 +1,44 @@ |
|||
.left-sidebar { |
|||
background-color: #0529ac; |
|||
color: white; |
|||
border-radius: 5px; |
|||
width: 110px; |
|||
} |
|||
.files{ |
|||
margin-top: 20px; |
|||
} |
|||
.file-icon{ |
|||
width: 65px; |
|||
margin-top: 42px; |
|||
margin-left: 5px; |
|||
} |
|||
.image{ |
|||
opacity: 80%; |
|||
width: 55px; |
|||
margin-left: 10px; |
|||
} |
|||
.card-img-top{ |
|||
width: 180px; |
|||
height: 180px; |
|||
} |
|||
.import{ |
|||
background-color: #ffffff; |
|||
color: #0529ac; |
|||
border-radius: 5px; |
|||
width: 100px; |
|||
border-color: unset; |
|||
margin-left: 10px |
|||
} |
|||
.upload{ |
|||
background-color: #0529ac; |
|||
color: white; |
|||
border-radius: 5px; |
|||
width: 100px; |
|||
margin-left: 10px; |
|||
} |
|||
.card{ |
|||
max-width: 15%; |
|||
height: 23rem; |
|||
border-radius: 1.25rem; |
|||
margin: 15px; |
|||
} |
@ -0,0 +1,59 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!-- Dashboard template --> |
|||
<template id="onedrive"> |
|||
<t t-name="OnedriveDashboard"> |
|||
<section class="dashboard_main_section" id="main_section_manager"> |
|||
<!-- OneDrive logo --> |
|||
<img src="/onedrive_integration_odoo/static/src/img/microsoft-onedrive.svg" |
|||
style="width:100px; margin-left: 10px;"/> |
|||
<img src="/onedrive_integration_odoo/static/src/img/onedrive_name.svg" |
|||
style="width:150px; margin-left: 15px;"/> |
|||
<!-- Import button --> |
|||
<input class="btn import" type="button" value="Import" |
|||
id="import"/> |
|||
<!-- Upload button --> |
|||
<input class="btn upload" type="button" value="Upload" |
|||
id="upload"/> |
|||
<div class="row"> |
|||
<div class="left-sidebar"> |
|||
<div class="files"> |
|||
<!-- File type: all files --> |
|||
<div class="file-type" value="allfiles"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/file.png"/> |
|||
</div> |
|||
<!-- File type: image --> |
|||
<div class="file-type" value="image"> |
|||
<img class="file-icon image" |
|||
src="onedrive_integration_odoo/static/src/img/image.png"/> |
|||
</div> |
|||
<!-- File type: PDF --> |
|||
<div class="file-type" value="pdf"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/pdf.png"/> |
|||
</div> |
|||
<!-- File type: Excel --> |
|||
<div class="file-type" value="xlsx"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/excel.png"/> |
|||
</div> |
|||
<!-- File type: ZIP --> |
|||
<div class="file-type" value="zip"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/zip.png"/> |
|||
</div> |
|||
<!-- File type: Text --> |
|||
<div class="file-type" value="txt"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/txt.png"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- Content area to display OneDrive files --> |
|||
<div class="col row content" |
|||
style="overflow-y: scroll; height: 80vh; background-color:lightgray;" |
|||
id="onedrive_files"/> |
|||
</div> |
|||
</section> |
|||
</t> |
|||
</template> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- The client action for OneDrive Dashboard --> |
|||
<record id="onedrive_dashboard_action" model="ir.actions.client"> |
|||
<field name="name">OneDrive Dashboard</field> |
|||
<field name="tag">onedrive_dashboard</field> |
|||
<field name="target">current</field> |
|||
</record> |
|||
<!-- A menu item for OneDrive Dashboard --> |
|||
<menuitem id="onedrive_dashboard_menu_root" |
|||
name="OneDrive Dashboard" |
|||
web_icon="onedrive_integration_odoo,static/description/icon.png" |
|||
action="onedrive_dashboard_action"/> |
|||
</odoo> |
@ -0,0 +1,51 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Defines the SetupToken view for settings --> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name">res.config.settings.inherit.view.onedrive.integration.odoo</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="inherit_id" ref="base.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[@name='integration']" position="inside"> |
|||
<!-- OneDrive settings --> |
|||
<div class="col-12 col-lg-6 o_setting_box" id="onedrive"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="is_onedrive_enabled" string="Microsoft OneDrive"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="is_onedrive_enabled"/> |
|||
<div class="text-muted"> |
|||
Synchronize with OneDrive |
|||
</div> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<span attrs="{'invisible': [('is_onedrive_enabled', '=', False)]}"> |
|||
Client ID: |
|||
<field name="onedrive_client" |
|||
attrs="{'invisible': [('is_onedrive_enabled', '=', False)]}"/> |
|||
</span> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<span attrs="{'invisible': [('is_onedrive_enabled', '=', False)]}"> |
|||
Client Secret: |
|||
<field name="onedrive_client_secret" password="True" |
|||
attrs="{'invisible': [('is_onedrive_enabled', '=', False)]}"/> |
|||
</span> |
|||
</div> |
|||
<button class="o_setting_right_pane btn btn-link" |
|||
name="action_get_onedrive_auth_code" type="object" |
|||
attrs="{'invisible': [('is_onedrive_enabled', '=', False)]}"> |
|||
<i class="fa fa-arrow-right"/>Setup Token |
|||
</button> |
|||
<div class="o_setting_right_pane"> |
|||
<span attrs="{'invisible': [('is_onedrive_enabled', '=', False)]}"> |
|||
Folder ID: |
|||
<field name="onedrive_folder" |
|||
attrs="{'invisible': [('is_onedrive_enabled', '=', False)]}"/> |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import upload_file |
@ -0,0 +1,83 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Aslam A K( odoo@cybrosys.com ) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
import requests |
|||
from odoo import exceptions, fields, models, _ |
|||
|
|||
|
|||
class UploadFile(models.TransientModel): |
|||
""" |
|||
For opening wizard view |
|||
""" |
|||
_name = "upload.file" |
|||
_description = "Upload File" |
|||
|
|||
file = fields.Binary(string="Attachment", help="Select a file to upload") |
|||
file_name = fields.Char(string="File Name", help="Name of the attachment") |
|||
|
|||
def action_upload_file(self): |
|||
""" |
|||
Upload file to onedrive |
|||
""" |
|||
if not self.file: |
|||
raise exceptions.UserError(_('Please Attach a file to upload.')) |
|||
attachment = self.env["ir.attachment"].search( |
|||
['|', ('res_field', '!=', False), ('res_field', '=', False), |
|||
('res_id', '=', self.id), |
|||
('res_model', '=', 'upload.file')]) |
|||
token = self.env['onedrive.dashboard'].search([], order='id desc', |
|||
limit=1) |
|||
folder = self.env['ir.config_parameter'].get_param( |
|||
'onedrive_integration_odoo.folder_id', '') |
|||
if not token or not folder: |
|||
raise exceptions.UserError( |
|||
_('Please setup Access Token and Folder Id.')) |
|||
if token.token_expiry_date <= str(fields.Datetime.now()): |
|||
token.generate_onedrive_refresh_token() |
|||
try: |
|||
url = "http://graph.microsoft.com/v1.0/me/drive/items/%s:/%s:/" \ |
|||
"createUploadSession" % (folder, self.file_name) |
|||
upload_session = requests.post(url, headers={ |
|||
'Content-Type': 'application/json', |
|||
'Authorization': 'Bearer "' + token.onedrive_access_token + '"' |
|||
}) |
|||
requests.put(upload_session.json().get('uploadUrl'), data=open( |
|||
(attachment._full_path(attachment.store_fname)), 'rb')) |
|||
return { |
|||
'type': 'ir.actions.client', |
|||
'tag': 'display_notification', |
|||
'params': { |
|||
'type': 'success', |
|||
'message': 'File has been uploaded successfully. ' |
|||
'Please refresh.', |
|||
'next': {'type': 'ir.actions.act_window_close'}, |
|||
} |
|||
} |
|||
except Exception as error: |
|||
return { |
|||
'type': 'ir.actions.client', |
|||
'tag': 'display_notification', |
|||
'params': { |
|||
'type': 'warning', |
|||
'message': 'Failed to upload: %s' % error, |
|||
'next': {'type': 'ir.actions.act_window_close'}, |
|||
} |
|||
} |
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Upload file wizard view --> |
|||
<record id="upload_file_view_form" model="ir.ui.view"> |
|||
<field name="name">upload.file.view.form</field> |
|||
<field name="model">upload.file</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="upload file wizard"> |
|||
<group class="oe_title"> |
|||
<field name="file" string="" filename="file_name"/> |
|||
<field name="file_name" invisible="1"/> |
|||
</group> |
|||
<footer> |
|||
<button string="Upload" name="action_upload_file" type="object" |
|||
class="oe_highlight" data-hotkey="q" help="Confirm Upload"/> |
|||
<button string="Cancel" class="btn btn-secondary" |
|||
special="cancel" help="Cancel Upload"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<record id="upload_file_action" model="ir.actions.act_window"> |
|||
<field name="name">Select a File</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">upload.file</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="upload_file_view_form"/> |
|||
<field name="target">new</field> |
|||
</record> |
|||
</odoo> |