@ -0,0 +1,54 @@ |
|||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
|||
:target: https://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 |
|||
|
|||
Installation |
|||
============ |
|||
- www.odoo.com/documentation/15.0/setup/install.html |
|||
- Install our custom addon |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (AGPL v3). |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
* Developer: (V15) 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 `Our Website <https://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,55 @@ |
|||
# -*- 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': "15.0.1.0.0'", |
|||
'category': "Productivity", |
|||
'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', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['base_setup'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'views/onedrive_dashboard_views.xml', |
|||
'views/res_config_settings_views.xml', |
|||
'wizard/upload_file_views.xml' |
|||
], |
|||
'assets': { |
|||
'web.assets_backend': [ |
|||
'/onedrive_integration_odoo/static/src/js/onedrive.js', |
|||
'/onedrive_integration_odoo/static/src/scss/onedrive.scss' |
|||
], |
|||
'web.assets_qweb': [ |
|||
'/onedrive_integration_odoo/static/src/xml/onedrive_dashboard_templates.xml', |
|||
], |
|||
}, |
|||
'images': ['static/description/banner.png'], |
|||
'uninstall_hook': 'uninstall_hook', |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'application': True, |
|||
'auto_install': False, |
|||
} |
@ -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,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/>. |
|||
# |
|||
############################################################################### |
|||
import json |
|||
from odoo import http |
|||
from odoo.http import request |
|||
|
|||
|
|||
class OnedriveAuth(http.Controller): |
|||
""" Controller to return URL """ |
|||
|
|||
@http.route('/onedrive/authentication', type='http', auth="public") |
|||
def oauth2callback(self, **kw): |
|||
""" Function to return URL for authentication """ |
|||
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,6 @@ |
|||
## Module <onedrive_integration_odoo> |
|||
|
|||
#### 14.09.2023 |
|||
#### Version 15.0.1.0.0 |
|||
#### ADD |
|||
- Initial commit for Onedrive Integration |
@ -0,0 +1,35 @@ |
|||
# -*- 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,143 @@ |
|||
# -*- 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): |
|||
"""Model for generating refresh and access tokens for OneDrive.""" |
|||
|
|||
_name = 'onedrive.dashboard' |
|||
_description = "OneDrive Dashboard" |
|||
|
|||
onedrive_access_token = fields.Char(string="OneDrive Access Token", |
|||
store=True, |
|||
help="Access token for OneDrive API " |
|||
"authentication") |
|||
onedrive_refresh_token = fields.Char(string="OneDrive Refresh Token", |
|||
help="Refresh token for obtaining " |
|||
"new access tokens") |
|||
token_expiry_date = fields.Char(string="OneDrive Token Validity", |
|||
help="Validity or expiration status of the" |
|||
" OneDrive access token") |
|||
upload_file = fields.Binary(string="Upload File", |
|||
help="Binary data of the file to be uploaded " |
|||
"to OneDrive") |
|||
|
|||
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,107 @@ |
|||
# -*- 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): |
|||
_inherit = 'res.config.settings' |
|||
|
|||
onedrive_client = fields.Char( |
|||
string='Onedrive Client ID', |
|||
copy=False, |
|||
config_parameter='onedrive_integration_odoo.client_id', |
|||
help='The Onedrive client ID from the Developer credentials.') |
|||
onedrive_client_secret = fields.Char( |
|||
string='Onedrive Client Secret', |
|||
config_parameter='onedrive_integration_odoo.client_secret', |
|||
help='The Onedrive client secret from Developer credentials.') |
|||
onedrive_access_token = fields.Char( |
|||
string='Onedrive Access Token', |
|||
help='Access token generated from onedrive') |
|||
onedrive_refresh_token = fields.Char( |
|||
string='Onedrive Refresh Token', |
|||
help='Refresh token generated from onedrive') |
|||
token_expiry_date = fields.Datetime( |
|||
string='Onedrive Token Validity', |
|||
help='Access token expiry date') |
|||
onedrive_folder = fields.Char( |
|||
string='Folder ID', |
|||
config_parameter='onedrive_integration_odoo.folder_id', |
|||
help='Onedrive Folder Id from url') |
|||
is_onedrive_integration = fields.Boolean( |
|||
string='Onedrive Cloud Storage', |
|||
config_parameter='onedrive_integration_odoo.onedrive_button', |
|||
default=False, |
|||
help="Login to Microsoft to get access token") |
|||
|
|||
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: 538 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 502 KiB |
After Width: | Height: | Size: 200 KiB |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 143 KiB |
After Width: | Height: | Size: 315 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 453 KiB |
After Width: | Height: | Size: 562 KiB |
After Width: | Height: | Size: 651 KiB |
After Width: | Height: | Size: 468 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 7.1 KiB |
@ -0,0 +1,788 @@ |
|||
<div style="background-color: #714B67; min-height: 600px; width: 100%; padding: 15px; position: relative;"> |
|||
<!-- TITLE BAR --> |
|||
<div class="d-flex align-items-center justify-content-between" |
|||
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 --> |
|||
<div class="container"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 col-md-12 col-lg-12"> |
|||
<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> |
|||
</div> |
|||
</div> |
|||
</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;"> |
|||
Create Onedrive api register application on |
|||
<a href="https://portal.azure.com/#home">Microsoft Azure Portal</a>. Give the Redirect URI as base url with |
|||
/onedrive/authentication. Eg: http://localhost:8015/onedrive/authentication </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.</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/15.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/15.0/whatsapp_redirect/" |
|||
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/15.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/15.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/4.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/15.0/developer_mode/" |
|||
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/15.0/sendinblue_connector/" |
|||
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,106 @@ |
|||
odoo.define('onedrive_integration_odoo.dashboard', function (require) { |
|||
'use strict'; |
|||
var AbstractAction = require('web.AbstractAction'); |
|||
var core = require('web.core'); |
|||
var _t = core._t; |
|||
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(); |
|||
}, |
|||
// Calls upload function on click of upload
|
|||
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', |
|||
}); |
|||
}, |
|||
// Appends files retrieved by function(action_synchronize_onedrive) to div onedrive_files on click of import
|
|||
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': _t('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': _t('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': _t('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 + ';"/></a>' + name + '</div>'); |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
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,49 @@ |
|||
.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: 1.1vw; |
|||
} |
|||
.card{ |
|||
max-width: 15%; |
|||
height: 23rem; |
|||
border-radius: 1.25rem; |
|||
margin: 15px; |
|||
} |
|||
.image{ |
|||
opacity: 80%; |
|||
width: 55px; |
|||
margin-left: 1.3vw; |
|||
} |
|||
.card-img-top{ |
|||
width: 10vw; |
|||
height: 22vh; |
|||
} |
|||
.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; |
|||
} |
|||
.onedrive_content{ |
|||
overflow-y: scroll; |
|||
height: 85vh; |
|||
background-color:lightgray; |
|||
} |
@ -0,0 +1,47 @@ |
|||
<?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"> |
|||
<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;"/> |
|||
<input class="btn import" type="button" value="Import" id="import"/> |
|||
<input class="btn upload" type="button" value="Upload" id="upload"/> |
|||
<div class="row"> |
|||
<!-- filters view --> |
|||
<div class="left-sidebar"> |
|||
<div class="files"> |
|||
<div class="file-type" value="allfiles"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/file.png"/> |
|||
</div> |
|||
<div class="file-type" value="image"> |
|||
<img class="file-icon image" |
|||
src="onedrive_integration_odoo/static/src/img/image.png"/> |
|||
</div> |
|||
<div class="file-type" value="pdf"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/pdf.png"/> |
|||
</div> |
|||
<div class="file-type" value="xlsx"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/excel.png"/> |
|||
</div> |
|||
<div class="file-type" value="zip"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/zip.png"/> |
|||
</div> |
|||
<div class="file-type" value="txt"> |
|||
<img class="file-icon" |
|||
src="onedrive_integration_odoo/static/src/img/txt.png"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col row onedrive_content" |
|||
id="onedrive_files"/> |
|||
</div> |
|||
</section> |
|||
</t> |
|||
</template> |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Menu view 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> |
|||
<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,60 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- SetupToken view on settings --> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name"> |
|||
res.config.settings.view.form.inherit.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"> |
|||
<div class="col-12 col-lg-6 o_setting_box" id="onedrive"> |
|||
<div class="o_setting_left_pane"> |
|||
<!-- Microsoft One Drive button --> |
|||
<field name="is_onedrive_integration" |
|||
string="Microsoft One Drive"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="is_onedrive_integration"/> |
|||
<div class="text-muted"> |
|||
<!-- Synchronize with OneDrive --> |
|||
Synchronize with OneDrive |
|||
</div> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<span attrs="{'invisible': [('is_onedrive_integration', '=', False)]}"> |
|||
<!-- Client ID --> |
|||
Client ID: |
|||
<field name="onedrive_client" |
|||
attrs="{'invisible': [('is_onedrive_integration', '=', False)]}"/> |
|||
</span> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<span attrs="{'invisible': [('is_onedrive_integration', '=', False)]}"> |
|||
<!-- Client Secret --> |
|||
Client Secret: |
|||
<field name="onedrive_client_secret" |
|||
password="True" |
|||
attrs="{'invisible': [('is_onedrive_integration', '=', False)]}"/> |
|||
</span> |
|||
</div> |
|||
<button class="o_setting_right_pane btn btn-link" |
|||
name="action_get_onedrive_auth_code" type="object" |
|||
attrs="{'invisible': [('is_onedrive_integration', '=', False)]}"> |
|||
<!-- Setup Token button --> |
|||
<i class="fa fa-arrow-right"/>Setup Token |
|||
</button> |
|||
<div class="o_setting_right_pane"> |
|||
<span attrs="{'invisible': [('is_onedrive_integration', '=', False)]}"> |
|||
<!-- Folder ID --> |
|||
Folder ID: |
|||
<field name="onedrive_folder" |
|||
attrs="{'invisible': [('is_onedrive_integration', '=', 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,90 @@ |
|||
# -*- 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): |
|||
""" Model for opening the file upload 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 file to upload") |
|||
|
|||
def action_upload_file(self): |
|||
"""Upload file to OneDrive.""" |
|||
if not self.file: |
|||
raise exceptions.UserError(_('Please attach a file to upload.')) |
|||
# Searching for attachments related to the current upload.file record |
|||
attachment = self.env["ir.attachment"].search( |
|||
['|', ('res_field', '!=', False), ('res_field', '=', False), |
|||
('res_id', '=', self.id), |
|||
('res_model', '=', 'upload.file')]) |
|||
# Getting the access token and folder ID from the onedrive.dashboard |
|||
# and ir.config_parameter models |
|||
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 set up Access Token and Folder ID.')) |
|||
# Refreshing the token if it has expired |
|||
if token.token_expiry_date <= str(fields.Datetime.now()): |
|||
token.generate_onedrive_refresh_token() |
|||
try: |
|||
# Creating an upload session for the file |
|||
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 + '"' |
|||
}) |
|||
upload_url = upload_session.json().get('uploadUrl') |
|||
# Uploading the file to the upload session URL |
|||
requests.put(upload_url, data=open( |
|||
(attachment._full_path(attachment.store_fname)), 'rb')) |
|||
# Returning a success notification |
|||
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: |
|||
# Returning a warning notification if the upload fails |
|||
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,24 @@ |
|||
<?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> |
|||
</odoo> |