diff --git a/rest_api_odoo/Postman Collections/Odoo REST Api.postman_collection.zip b/rest_api_odoo/Postman Collections/Odoo REST Api.postman_collection.zip new file mode 100644 index 000000000..d2a8392f5 Binary files /dev/null and b/rest_api_odoo/Postman Collections/Odoo REST Api.postman_collection.zip differ diff --git a/rest_api_odoo/README.rst b/rest_api_odoo/README.rst new file mode 100644 index 000000000..54af7b6da --- /dev/null +++ b/rest_api_odoo/README.rst @@ -0,0 +1,52 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: https://www.gnu.org/licenses/lgpl-3.0.en.html + :alt: License: LGPL-3 + +Odoo rest API +============= +* This module allow us to connect to database with REST API requests + +Configuration +----------- +* Set up the config file +* Authentication using Postman with login credentials +* API key generation +* Communicate with database using API requests + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License v3.0 (LGPL v3) +(https://www.gnu.org/licenses/lgpl-3.0.en.html) + +Credits +------- +Developer : (V18) Ayana KP, + (V16) Yadhushankar, + (V17) Sruthi pavithran +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 `__ + +Further information +=================== +HTML Description: ``__ diff --git a/rest_api_odoo/__init__.py b/rest_api_odoo/__init__.py new file mode 100644 index 000000000..b436cbd12 --- /dev/null +++ b/rest_api_odoo/__init__.py @@ -0,0 +1,23 @@ +# -*- coding:utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/rest_api_odoo/__manifest__.py b/rest_api_odoo/__manifest__.py new file mode 100644 index 000000000..d7cd5c3b6 --- /dev/null +++ b/rest_api_odoo/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + "name": "Odoo rest API", + "version": "18.0.1.0.0", + "category": "Tools", + "summary": """This app helps to interact with odoo, backend with help of + rest api requests""", + "description": """The odoo Rest API module allow us to connect to database + with the help of GET , POST , PUT and DELETE requests""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + "depends": ['base', 'web'], + "data": [ + 'security/ir.model.access.csv', + 'views/res_users_views.xml', + 'views/connection_api_views.xml' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/rest_api_odoo/controllers/__init__.py b/rest_api_odoo/controllers/__init__.py new file mode 100644 index 000000000..12d071cc4 --- /dev/null +++ b/rest_api_odoo/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding:utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import rest_api_odoo diff --git a/rest_api_odoo/controllers/rest_api_odoo.py b/rest_api_odoo/controllers/rest_api_odoo.py new file mode 100644 index 000000000..7faac657a --- /dev/null +++ b/rest_api_odoo/controllers/rest_api_odoo.py @@ -0,0 +1,239 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import json +import logging +from odoo import http +from odoo.http import request + +_logger = logging.getLogger(__name__) + + +class RestApi(http.Controller): + """This is a controller which is used to generate responses based on the + api requests""" + + def auth_api_key(self, api_key): + """This function is used to authenticate the api-key when sending a + request""" + user_id = request.env['res.users'].sudo().search([('api_key', '=', api_key)]) + if api_key is not None and user_id: + response = True + elif not user_id: + response = ('

Invalid API Key ' + '!

') + else: + response = ("

No API Key Provided " + "!

") + return response + + def generate_response(self, method, model, rec_id): + """This function is used to generate the response based on the type + of request and the parameters given""" + option = request.env['connection.api'].search( + [('model_id', '=', model)], limit=1) + model_name = option.model_id.model + if method != 'DELETE': + data = json.loads(request.httprequest.data) + else: + data = {} + fields = [] + if data: + for field in data['fields']: + fields.append(field) + if not fields and method != 'DELETE': + return ("

No fields selected for the model" + "

") + if not option: + return ("

No Record Created for the model" + "

") + try: + if method == 'GET': + fields = [] + for field in data['fields']: + fields.append(field) + if not option.is_get: + return ("

Method Not Allowed" + "

") + else: + datas = [] + if rec_id != 0: + partner_records = request.env[ + str(model_name)].search_read( + domain=[('id', '=', rec_id)], + fields=fields + ) + data = json.dumps({ + 'records': partner_records + }) + datas.append(data) + return request.make_response(data=datas) + else: + partner_records = request.env[ + str(model_name)].search_read( + domain=[], + fields=fields + ) + data = json.dumps({ + 'records': partner_records + }) + datas.append(data) + return request.make_response(data=datas) + except: + return ("

Invalid JSON Data" + "

") + if method == 'POST': + if not option.is_post: + return ("

Method Not Allowed" + "

") + else: + try: + data = json.loads(request.httprequest.data) + datas = [] + new_resource = request.env[str(model_name)].create( + data['values']) + partner_records = request.env[ + str(model_name)].search_read( + domain=[('id', '=', new_resource.id)], + fields=fields + ) + new_data = json.dumps({'New resource': partner_records, }) + datas.append(new_data) + return request.make_response(data=datas) + except: + return ("

Invalid JSON Data" + "

") + if method == 'PUT': + if not option.is_put: + return ("

Method Not Allowed" + "

") + else: + if rec_id == 0: + return ("

No ID Provided" + "

") + else: + resource = request.env[str(model_name)].browse( + int(rec_id)) + if not resource.exists(): + return ("

Resource not found" + "

") + else: + try: + datas = [] + data = json.loads(request.httprequest.data) + resource.write(data['values']) + partner_records = request.env[ + str(model_name)].search_read( + domain=[('id', '=', resource.id)], + fields=fields + ) + new_data = json.dumps( + {'Updated resource': partner_records, + }) + datas.append(new_data) + return request.make_response(data=datas) + + except: + return ("

Invalid JSON Data " + "!

") + if method == 'DELETE': + if not option.is_delete: + return ("

Method Not Allowed" + "

") + else: + if rec_id == 0: + return ("

No ID Provided" + "

") + else: + resource = request.env[str(model_name)].browse( + int(rec_id)) + if not resource.exists(): + return ("

Resource not found" + "

") + else: + + records = request.env[ + str(model_name)].search_read( + domain=[('id', '=', resource.id)], + fields=['id', 'display_name'] + ) + remove = json.dumps( + {"Resource deleted": records, + }) + resource.unlink() + return request.make_response(data=remove) + + @http.route(['/send_request'], type='http', + auth='none', + methods=['GET', 'POST', 'PUT', 'DELETE'], csrf=False) + def fetch_data(self, **kw): + """This controller will be called when sending a request to the + specified url, and it will authenticate the api-key and then will + generate the result""" + http_method = request.httprequest.method + api_key = request.httprequest.headers.get('api-key') + auth_api = self.auth_api_key(api_key) + model = kw.get('model') + username = request.httprequest.headers.get('login') + password = request.httprequest.headers.get('password') + credential = {'login': username, 'password': password, 'type': 'password'} + request.session.authenticate(request.session.db, credential) + model_id = request.env['ir.model'].search( + [('model', '=', model)]) + if not model_id: + return ("

Invalid model, check spelling or maybe " + "the related " + "module is not installed" + "

") + + if auth_api == True: + if not kw.get('Id'): + rec_id = 0 + else: + rec_id = int(kw.get('Id')) + result = self.generate_response(http_method, model_id.id, rec_id) + return result + else: + return auth_api + + @http.route(['/odoo_connect'], type="http", auth="none", csrf=False, + methods=['GET']) + def odoo_connect(self, **kw): + """This is the controller which initializes the api transaction by + generating the api-key for specific user and database""" + username = request.httprequest.headers.get('login') + password = request.httprequest.headers.get('password') + db = request.httprequest.headers.get('db') + try: + request.session.update(http.get_default_session(), db=db) + credential = {'login': username, 'password': password, + 'type': 'password'} + + auth = request.session.authenticate(db, credential) + user = request.env['res.users'].browse(auth['uid']) + api_key = request.env.user.generate_api(username) + datas = json.dumps({"Status": "auth successful", + "User": user.name, + "api-key": api_key}) + return request.make_response(data=datas) + except: + return ("

wrong login credentials" + "

") diff --git a/rest_api_odoo/doc/RELEASE_NOTES.md b/rest_api_odoo/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..bd4042da0 --- /dev/null +++ b/rest_api_odoo/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 02.12.2024 +#### Version 18.0.1.0.0 + - Initial Commit for Odoo rest API diff --git a/rest_api_odoo/models/__init__.py b/rest_api_odoo/models/__init__.py new file mode 100644 index 000000000..8cd2c0c51 --- /dev/null +++ b/rest_api_odoo/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding:utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import connection_api +from . import res_users diff --git a/rest_api_odoo/models/connection_api.py b/rest_api_odoo/models/connection_api.py new file mode 100644 index 000000000..52da21c0f --- /dev/null +++ b/rest_api_odoo/models/connection_api.py @@ -0,0 +1,47 @@ +# -*- coding:utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ConnectionApi(models.Model): + """This class is used to create an api model in which we can create + records with models and fields, and also we can specify methods.""" + _name = 'connection.api' + _description = 'Connection Rest Api' + _rec_name = 'model_id' + + model_id = fields.Many2one('ir.model', string="Model", + domain="[('transient', '=', False)]", + help="Select model which can be accessed by " + "REST api requests.") + is_get = fields.Boolean(string='GET', + help="Select this to enable GET method " + "while sending requests.") + is_post = fields.Boolean(string='POST', + help="Select this to enable POST method" + "while sending requests.") + is_put = fields.Boolean(string='PUT', + help="Select this to enable PUT method " + "while sending requests.") + is_delete = fields.Boolean(string='DELETE', + help="Select this to enable DELETE method " + "while sending requests.") diff --git a/rest_api_odoo/models/res_users.py b/rest_api_odoo/models/res_users.py new file mode 100644 index 000000000..b12d6e674 --- /dev/null +++ b/rest_api_odoo/models/res_users.py @@ -0,0 +1,44 @@ +# -*- coding:utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import uuid +from odoo import fields, models + + +class ResUsers(models.Model): + """This class is used to inherit users and add api key generation""" + _inherit = 'res.users' + + api_key = fields.Char(string="API Key", readonly=True, + help="Api key for connecting with the " + "Database.The key will be " + "generated when authenticating " + "rest api.") + + def generate_api(self, username): + """This function is used to generate api-key for each user""" + users = self.env['res.users'].sudo().search([('login', '=', username)]) + if not users.api_key: + users.api_key = str(uuid.uuid4()) + key = users.api_key + else: + key = users.api_key + return key diff --git a/rest_api_odoo/security/ir.model.access.csv b/rest_api_odoo/security/ir.model.access.csv new file mode 100644 index 000000000..042bd737c --- /dev/null +++ b/rest_api_odoo/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_connection_api_user,access.connection.api.user,model_connection_api,,1,1,1,1 diff --git a/rest_api_odoo/static/description/assets/cybro-icon.png b/rest_api_odoo/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/rest_api_odoo/static/description/assets/cybro-icon.png differ diff --git a/rest_api_odoo/static/description/assets/cybro-odoo.png b/rest_api_odoo/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/rest_api_odoo/static/description/assets/cybro-odoo.png differ diff --git a/rest_api_odoo/static/description/assets/h2.png b/rest_api_odoo/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/rest_api_odoo/static/description/assets/h2.png differ diff --git a/rest_api_odoo/static/description/assets/icons/arrows-repeat.svg b/rest_api_odoo/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/banner-1.png b/rest_api_odoo/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/banner-1.png differ diff --git a/rest_api_odoo/static/description/assets/icons/banner-2.svg b/rest_api_odoo/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/banner-bg.png b/rest_api_odoo/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/banner-bg.png differ diff --git a/rest_api_odoo/static/description/assets/icons/banner-bg.svg b/rest_api_odoo/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/banner-call.svg b/rest_api_odoo/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/banner-mail.svg b/rest_api_odoo/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/banner-pattern.svg b/rest_api_odoo/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/banner-promo.svg b/rest_api_odoo/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/brand-pair.svg b/rest_api_odoo/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/check.png b/rest_api_odoo/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/check.png differ diff --git a/rest_api_odoo/static/description/assets/icons/chevron.png b/rest_api_odoo/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/chevron.png differ diff --git a/rest_api_odoo/static/description/assets/icons/close-icon.svg b/rest_api_odoo/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/cogs.png b/rest_api_odoo/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/cogs.png differ diff --git a/rest_api_odoo/static/description/assets/icons/collabarate-icon.svg b/rest_api_odoo/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/rest_api_odoo/static/description/assets/icons/consultation.png b/rest_api_odoo/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/consultation.png differ diff --git a/rest_api_odoo/static/description/assets/icons/cybro-logo.png b/rest_api_odoo/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/cybro-logo.png differ diff --git a/rest_api_odoo/static/description/assets/icons/down.svg b/rest_api_odoo/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/rest_api_odoo/static/description/assets/icons/ecom-black.png b/rest_api_odoo/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/ecom-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/education-black.png b/rest_api_odoo/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/education-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/faq.png b/rest_api_odoo/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/faq.png differ diff --git a/rest_api_odoo/static/description/assets/icons/feature-icon.svg b/rest_api_odoo/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/feature.png b/rest_api_odoo/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/feature.png differ diff --git a/rest_api_odoo/static/description/assets/icons/gear.svg b/rest_api_odoo/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/hero.gif b/rest_api_odoo/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/hero.gif differ diff --git a/rest_api_odoo/static/description/assets/icons/hire-odoo.svg b/rest_api_odoo/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/hotel-black.png b/rest_api_odoo/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/hotel-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/license.png b/rest_api_odoo/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/license.png differ diff --git a/rest_api_odoo/static/description/assets/icons/life-ring-icon.svg b/rest_api_odoo/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/lifebuoy.png b/rest_api_odoo/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/lifebuoy.png differ diff --git a/rest_api_odoo/static/description/assets/icons/mail.svg b/rest_api_odoo/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/rest_api_odoo/static/description/assets/icons/manufacturing-black.png b/rest_api_odoo/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/manufacturing-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/notes.png b/rest_api_odoo/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/notes.png differ diff --git a/rest_api_odoo/static/description/assets/icons/notification icon.svg b/rest_api_odoo/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/odoo-consultancy.svg b/rest_api_odoo/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/rest_api_odoo/static/description/assets/icons/odoo-licencing.svg b/rest_api_odoo/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/rest_api_odoo/static/description/assets/icons/odoo-logo.png b/rest_api_odoo/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/odoo-logo.png differ diff --git a/rest_api_odoo/static/description/assets/icons/patter.svg b/rest_api_odoo/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/pattern1.png b/rest_api_odoo/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/pattern1.png differ diff --git a/rest_api_odoo/static/description/assets/icons/pos-black.png b/rest_api_odoo/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/pos-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/puzzle-piece-icon.svg b/rest_api_odoo/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/puzzle.png b/rest_api_odoo/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/puzzle.png differ diff --git a/rest_api_odoo/static/description/assets/icons/replace-icon.svg b/rest_api_odoo/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/restaurant-black.png b/rest_api_odoo/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/restaurant-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/screenshot-main.png b/rest_api_odoo/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/screenshot-main.png differ diff --git a/rest_api_odoo/static/description/assets/icons/screenshot.png b/rest_api_odoo/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/screenshot.png differ diff --git a/rest_api_odoo/static/description/assets/icons/service-black.png b/rest_api_odoo/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/service-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/skype-fill.svg b/rest_api_odoo/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/skype.png b/rest_api_odoo/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/skype.png differ diff --git a/rest_api_odoo/static/description/assets/icons/skype.svg b/rest_api_odoo/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/rest_api_odoo/static/description/assets/icons/star-1.svg b/rest_api_odoo/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/star-2.svg b/rest_api_odoo/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/support.png b/rest_api_odoo/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/support.png differ diff --git a/rest_api_odoo/static/description/assets/icons/test-1 - Copy.png b/rest_api_odoo/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/test-1 - Copy.png differ diff --git a/rest_api_odoo/static/description/assets/icons/test-1.png b/rest_api_odoo/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/test-1.png differ diff --git a/rest_api_odoo/static/description/assets/icons/test-2.png b/rest_api_odoo/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/test-2.png differ diff --git a/rest_api_odoo/static/description/assets/icons/trading-black.png b/rest_api_odoo/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/trading-black.png differ diff --git a/rest_api_odoo/static/description/assets/icons/training.png b/rest_api_odoo/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/training.png differ diff --git a/rest_api_odoo/static/description/assets/icons/translate.svg b/rest_api_odoo/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/update.png b/rest_api_odoo/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/update.png differ diff --git a/rest_api_odoo/static/description/assets/icons/user.png b/rest_api_odoo/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/user.png differ diff --git a/rest_api_odoo/static/description/assets/icons/video.png b/rest_api_odoo/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/video.png differ diff --git a/rest_api_odoo/static/description/assets/icons/whatsapp.png b/rest_api_odoo/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/whatsapp.png differ diff --git a/rest_api_odoo/static/description/assets/icons/wrench-icon.svg b/rest_api_odoo/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/rest_api_odoo/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/rest_api_odoo/static/description/assets/icons/wrench.png b/rest_api_odoo/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/rest_api_odoo/static/description/assets/icons/wrench.png differ diff --git a/rest_api_odoo/static/description/assets/modules/1.jpg b/rest_api_odoo/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..3cb15fe01 Binary files /dev/null and b/rest_api_odoo/static/description/assets/modules/1.jpg differ diff --git a/rest_api_odoo/static/description/assets/modules/2.jpg b/rest_api_odoo/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..662cadcc3 Binary files /dev/null and b/rest_api_odoo/static/description/assets/modules/2.jpg differ diff --git a/rest_api_odoo/static/description/assets/modules/3.jpg b/rest_api_odoo/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..717a00443 Binary files /dev/null and b/rest_api_odoo/static/description/assets/modules/3.jpg differ diff --git a/rest_api_odoo/static/description/assets/modules/4.png b/rest_api_odoo/static/description/assets/modules/4.png new file mode 100644 index 000000000..00ebf54ad Binary files /dev/null and b/rest_api_odoo/static/description/assets/modules/4.png differ diff --git a/rest_api_odoo/static/description/assets/modules/5.jpg b/rest_api_odoo/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..7c67e2eec Binary files /dev/null and b/rest_api_odoo/static/description/assets/modules/5.jpg differ diff --git a/rest_api_odoo/static/description/assets/modules/6.gif b/rest_api_odoo/static/description/assets/modules/6.gif new file mode 100644 index 000000000..a35ece8df Binary files /dev/null and b/rest_api_odoo/static/description/assets/modules/6.gif differ diff --git a/rest_api_odoo/static/description/assets/screenshots/V-18-GIF.gif b/rest_api_odoo/static/description/assets/screenshots/V-18-GIF.gif new file mode 100644 index 000000000..df74e4e3a Binary files /dev/null and b/rest_api_odoo/static/description/assets/screenshots/V-18-GIF.gif differ diff --git a/rest_api_odoo/static/description/assets/screenshots/rest_api.png b/rest_api_odoo/static/description/assets/screenshots/rest_api.png new file mode 100644 index 000000000..daaebe23b Binary files /dev/null and b/rest_api_odoo/static/description/assets/screenshots/rest_api.png differ diff --git a/rest_api_odoo/static/description/assets/screenshots/rest_api_1.png b/rest_api_odoo/static/description/assets/screenshots/rest_api_1.png new file mode 100644 index 000000000..62c63630a Binary files /dev/null and b/rest_api_odoo/static/description/assets/screenshots/rest_api_1.png differ diff --git a/rest_api_odoo/static/description/assets/screenshots/rest_api_2.png b/rest_api_odoo/static/description/assets/screenshots/rest_api_2.png new file mode 100644 index 000000000..45063358e Binary files /dev/null and b/rest_api_odoo/static/description/assets/screenshots/rest_api_2.png differ diff --git a/rest_api_odoo/static/description/assets/screenshots/rest_api_3.png b/rest_api_odoo/static/description/assets/screenshots/rest_api_3.png new file mode 100644 index 000000000..3d5367f65 Binary files /dev/null and b/rest_api_odoo/static/description/assets/screenshots/rest_api_3.png differ diff --git a/rest_api_odoo/static/description/assets/screenshots/rest_api_4.png b/rest_api_odoo/static/description/assets/screenshots/rest_api_4.png new file mode 100644 index 000000000..55b5f42e6 Binary files /dev/null and b/rest_api_odoo/static/description/assets/screenshots/rest_api_4.png differ diff --git a/rest_api_odoo/static/description/assets/screenshots/rest_api_5.png b/rest_api_odoo/static/description/assets/screenshots/rest_api_5.png new file mode 100644 index 000000000..2bfe803c0 Binary files /dev/null and b/rest_api_odoo/static/description/assets/screenshots/rest_api_5.png differ diff --git a/rest_api_odoo/static/description/assets/y18.jpg b/rest_api_odoo/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/rest_api_odoo/static/description/assets/y18.jpg differ diff --git a/rest_api_odoo/static/description/banner.jpg b/rest_api_odoo/static/description/banner.jpg new file mode 100644 index 000000000..a68ae5a1b Binary files /dev/null and b/rest_api_odoo/static/description/banner.jpg differ diff --git a/rest_api_odoo/static/description/icon.png b/rest_api_odoo/static/description/icon.png new file mode 100644 index 000000000..17a951e3b Binary files /dev/null and b/rest_api_odoo/static/description/icon.png differ diff --git a/rest_api_odoo/static/description/index.html b/rest_api_odoo/static/description/index.html new file mode 100644 index 000000000..bbb94dc64 --- /dev/null +++ b/rest_api_odoo/static/description/index.html @@ -0,0 +1,1362 @@ + + + + + + Odoo rest API + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ + + + +
+
+ +
+
+
+
+

+ The odoo Rest API module allow us to connect to database + with the help of GET , POST , PUT and DELETE request. +

+

Odoo rest API +

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

Key + Highlights

+
+
+
+
+ +
+
+ Api Key Generation +
+

+ This module + Api key generation using database + authentication.

+
+
+
+
+
+ +
+
+ Create Records +
+

+ Can create + records for the models we want to access. +

+
+
+
+
+
+ +
+
+ Methods +
+

+ This module + Choose specific methods like GET, POST etc. +

+
+
+
+
+
+ +
+
+ Create & Updates +
+

+ This module + Create and + update records from database. +

+
+
+
+
+
+ +
+
+ Delete +
+

+ This module + Choose DELETE method to delete records. +

+
+
+
+
+ +
+
+
+ Odoo rest API +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Configuration + +

+
+
+

+

    +
  • First of all, we have to add a new + parameter in odoo conf. + file. +
  • +
  • server_wide_modules = web, base, + rest_api_odoo
    + - This will allow us to send request + to + server without + selecting database first.
    - + Incase + if you have to + uninstall the module , you have to + remove this parameter. +
    - Next we can install the + module. +
  • +
  • After installing the Rest api app we + can + see a new api key + field in users. +
  • + - Next we have to generate the api-key + for + the current + user.
    +
  • You can import the postman + collections + provided in the app + folder for authentication and + interacting with database in + various methods. +
  • +
+

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

+ + Postman + collections +

+
+
+

+

    +
  • We have attached Postman + collections through which + you can + authenticate rest api. +
  • +
  • First, extract the zip file. + Then, you will obtain the + JSON-format + file, which you can directly import + into + POSTMAN.
  • +
  • The url format will be like this - + http://localhost:8018/odoo_connect + Replace 'localhost:8018' with your + localhost port number. +
  • +
  • You have to provide database name, + username and password + through the headers while sending + request. +
  • +
  • If the authentication is successful + , an + api key will be + generated for the current user. +
  • +
  • This key will be used when sending + api + requests to + database. +
  • +
  • The response will be like this - + {"Status": "auth + successful", "User": "Mitchell + Admin", + "api-key": + "66c2ebab-d4dc-42f0-87d0-d1646e887569"}. +
  • +
+

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

+ API Authentication + +

+
+
+

+

    +
  • After rest api authentication, we + can + create records in the + rest api app. +
  • +
  • Here we can choose the model, and + also + we can + choose the http methods. +
  • +
  • The api response will be based on + these + records. +
  • +
+

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

+ Get Records + +

+
+
+

+

    +
  • You can send GET request to retrieve + data from the + database. +
  • +
  • The postman collection has been provided + with--> + app files for + sending request from postman. +
  • +
  • You have to provide username, password + and api + key through + the header. +
  • +
  • Model can be passed as argument as the + technical + name , and + also if you want + specific record you can provide the id + as well, +
  • +
  • The format for GET method will be like + this + http://localhost:8018/send_request?model=res.partner&Id=10. +
  • +
  • We can specify the fields inside the + JSON data, + and it will + be like this - {"fields": ["name", + "email"]}.
  • +
  • This is the format of api response - {"records": + [{"id": + 10, "email": + "deco.addict82@example.com", + "name": "Deco + Addict"}]}. +
  • + +
+

+
+ +
+
+
+
+
+
+
+

+ Create Records + +

+
+
+

+

    +
  • Using POST method , you can create + new records + in the + database. +
  • +
  • Just make sure you enabled POST + method for the + model record + in rest api app , otherwise you will + get 'method + not + allowed' message. +
  • +
  • For creating record you have to + provide the JSON + data along + with the model. +
  • +
  • You can make use of the postman + collection that + we have + added with app files. +
  • +
  • The format for sending POST request + will be like + this - http://localhost:8018/send_request?model=res.partner. +
  • +
  • This is the format for JSON data - + { + "fields" :["name", "phone"] , + "values": {"name": "abc", + "phone":"55962441552" + } }. +
  • +
  • Make sure the data entered in + correct format + otherwise you + will get 'Invalid JSON data' + message. +
  • +
  • Response will be in this format - + {"New + resource": + [{"id": 51, "name": "abc", + "phone": + "55962441552"}]}. +
  • +
+

+
+ +
+
+
+
+
+
+
+

+ Update Records + +

+
+
+

+

    +
  • Updation of records in the database + can be done + with PUT + method. +
  • +
  • You have to provide the model and + also the id or + the record + that you want to update. +
  • +
  • You can use the Postman collection + that we have + provided and , you + will be always have to send request + with your + login + credentials. Otherwise, it will be + showing + access denied. +
  • +
  • The format for sending PUT request + will be like + this - http://localhost:8018/send_request?model=res.partner&Id=46. +
  • +
  • Here too you have to provide the + JSON data + through which the + updates will be done. +
  • +
  • The response format will be like + this - {"Updated + resource": [{"id": 46, "email": + "abc@example.com", "name": + "Toni"}]}.
  • +
+

+
+ +
+
+
+
+
+
+
+

+ Delete Records + +

+
+
+

+

    +
  • Database records can be deleted by + sending + DELETE method + request. +
  • +
  • For the deletion we have to provide + the Model + and the record + id that we want to delete. +
  • +
  • Make sure you have permission to + delete files + for the + selected model in the rest api + record. +
  • +
  • The delete request format will be + like this - + http://localhost:8018/send_request?model=res.partner&Id=46. +
  • +
  • The response after successful + deletion will be + - + {"Resource deleted": [{"id": 46, + "email": + "abc@example.com", + "name": "Toni"}]}.
  • +
+

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

+ We can create + records in the rest api app. +

+
+ +
+
+
+
+
+
+ +
+

+ request to retrieve data from the database.

+
+
+
+
+
+
+
+ +
+

+ Update of + records in the database can be done with PUT + method.

+
+
+
+
+
+
+
+ +
+

+ Database records + can be deleted by sending DELETE method request.

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

+ The Odoo REST API module allows users to connect to the Odoo database and perform operations using standard HTTP methods: GET, POST, PUT, and DELETE. +

+
+
+ +
+ +
+

+ It enables developers to integrate Odoo with other applications and systems, facilitating seamless data exchange and enhancing functionality. +

+
+
+ +
+ +
+

+ Users can make GET requests to retrieve data, POST requests to create new records, PUT requests to update existing records, and DELETE requests to remove records from the database. +

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

+ Latest Release 18.0.1.0.0 +

+ + 1st October, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/rest_api_odoo/views/connection_api_views.xml b/rest_api_odoo/views/connection_api_views.xml new file mode 100644 index 000000000..1ae15d1f5 --- /dev/null +++ b/rest_api_odoo/views/connection_api_views.xml @@ -0,0 +1,61 @@ + + + + + connection.api.view.form + connection.api + +
+ + + + + + + + + + + + + +
+
+
+ + + connection.api.view.list + connection.api + + + + + + + + + + + + + Rest API Records + ir.actions.act_window + connection.api + list,form + +

+ Create! +

+
+
+ + + +
diff --git a/rest_api_odoo/views/res_users_views.xml b/rest_api_odoo/views/res_users_views.xml new file mode 100644 index 000000000..c6a59b1ef --- /dev/null +++ b/rest_api_odoo/views/res_users_views.xml @@ -0,0 +1,18 @@ + + + + + view.users.form.inherit.rest.api.odoo + + res.users + + + + + + + + + + +