Odoo Connect
by Tunisofts https://www.tunisofts.com/ , By Shayma T https://www.tunisofts.com/ , Wissal L https://www.tunisofts.com/ , Helmi D https://www.tunisofts.com/$ 453.72
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Website (website)
• Discuss (mail) |
Lines of code | 34736 |
Technical Name |
odoo_connect |
License | LGPL-3 |
Website | https://www.tunisofts.com/ |
Versions | 16.0 17.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Website (website)
• Discuss (mail) |
Lines of code | 34736 |
Technical Name |
odoo_connect |
License | LGPL-3 |
Website | https://www.tunisofts.com/ |
Versions | 16.0 17.0 |

Key Features:
RESTful API Creation
Easily generate RESTful APIs within Odoo to facilitate data creation, consumption, editing, and deletion.
Customizable Endpoints
Tailor API endpoints to match your specific data requirements.
Secure Authentication
A robust authentication mechanisms to ensure data security.
Data Filtering and Pagination
Enable data filtering and pagination options for efficient data retrieval.
Documentation Generation
Automatically generate instant API documentation for ease of use and integration.
Responsive Design
Responsive design for Desktop, Tablet, and Mobile phones
Odoo Connect Screen:
User Guide:
Installation
- Copy and paste it to your Add-ons folder.
- Click on Update Apps list from the menu and now Odoo Connect
will appear in Apps list.
- Go to Apps menu, search for 'odoo connect' and click Install button.
- You are ready for use Odoo Connect.
Get started
- The API name
- Optionally, you can select a customized template from the provided list to create your endpoint.
- The name is mandatory and must be unique for each endpoint.
- The key used when requesting the endpoint is automatically generated from the name field.
- The method for the endpoint can be specified as : GET to fetch records, POST to create new records, PUT to update an existing record, DELETE to delete a record and REPORT to get a PDF or an Excel report.
- Specify the model you want to interact with its data.
- You have the flexibility to make your endpoints available to the public or restrict access to authorized users only.
- The model Fields that can be displayed for users
- Clicking the "Add New Field" button allows you to select fields that you want to include in your request.
- When you click the edit button associated with "one2many", "many2one", or "many2many" fields, you can then choose from the fields of the corresponding relational model.
- You have the option to order the records based on the desired field.
- You can select either an ascending or descending order.
- You have the capability to define a domain of data to limit access to specific
records.
- You have the ability to define the fields that the user is allowed to use for filtering.
- You can allow users to attach a file in creation or editing record(s) (POST and PUT methods).
- It is possible to set default values for specific fields when you attempt to
create new records (POST method).
Ensure that you supply the data in the following format: {"field1":"value","field2":"value"} - You have the option to select the type of reports you want to generate, whether it will be in PDF or Excel format.
- You can decide whether to receive the URL of the report or download the file directly.
- When generating PDF reports, it is necessary to select the report template that corresponds to the chosen model.



For both domain and default values fields, if the value starts with "user" followed by ".attribute," where "attribute" is a field from the `res.users` model, "user.attribute" will represent the actual value rather than a string.
example: [("partner_id","=","user.partner_id")] or {"partner_id":"user.partner_id"}: in these cases, the value of user.partner_id.id will not be treated as a string; instead, it will be assigned as the user's partner_id to the partner_id field of the chosen model.

Authentication
- When signing up, a verification code is sent to your email
- If you don't verify your email within 5 minutes, you can request to resend the code.
- Upon login, a token is generated and remains valid for 24 hours.
- Password reset functionality is available.
- Users can log out to terminate their session.
Create your first API
- Once you launch the application, a tree view showcasing the APIs will be displayed.
- To generate a new API, simply click the "Create" button located in the top-left corner of your API screen.
- Your API remains unpublished until you click the "Unpublished" button. Once published, users can utilize your endpoints and access the documentation.
- By clicking on the "Preview" button, you can access the documentation associated with your API.
- Once you've supplied the required information for your API, you can proceed to generate the endpoints by selecting the "API Lines" button located at the top-right corner of your API form. You will be directed to the endpoints tree associated with your API. From there, you can initiate the creation process by clicking on the "Create" button.


POST method
- Choose the model for record creation.
- Define the fields that users should fill them. By default, the mandatory fields are automatically mapped to Api Fields.
- You can enable the "Accept Attachment" field to permit file attachments to new records. By default, if one of the model fields is related to "ir.attachment" model the new attachment will be automatically assigned to that field.
- Some fields require specific values, and to prevent errors when creating new
records, you can assign default values to them using
"default value" field.
As the below example, all the records will be generated with the `company_id` set to 1:

GET method

- Select the desired model for reading records.
- Choose specific fields to display. If you don't choose any fields, you will get the id and the name by default.
- You can sort results based on the selected field in "Sort By Field".
- You can apply data filtering using domains.
- If you use tha attributes of res.users model, the count of records shown will not always be accurate. It's recommended to test it yourself with an API platform.
- Choose the allowed fields that the user can filter on.
PUT method
- Select the model for record editing.
- Define fields that users have the right to modify.
- Optionally enable the "Accept Attachment" field to permit file attachments during record updates (Similar to POST method).
- Define a domain for updating record in case users did not include the record ID in their requests. This works only if your domain returns only one record.
- You can set default values for specific fields for the PUT method (Similar to POST method).

DELETE method

- Identify the model for which users have deletion rights.
- Users can delete records by their id as per their permissions.
Reporting (PDF / Excel)

- Choose the report format (PDF or Excel).
- For PDF reports, select from available templates related to the specified model.
- For Excel reports, customize fields to include in the report (Similar to GET method).
- Opt for either a downloadable file or a JSON response containing the file's URL.

Create from templates
- You can create endpoints using the provided templates by clicking the "Create
from
templates" button in the API form.
- Next, click on "Add a line" and select your preferred templates from the list.
Subsequently, click on "Select" to proceed.
-
You have the option to utilize a template for creating a new endpoint and subsequently customize it according to your preferences.
Automatic documentation
- The documentation begins with an overview of the authentication process.
- For each endpoint, a concise description is provided.
- If the API includes specific fields, they will be presented with their descriptions, names, and types.
- The documentation displays parameters that users can include in their requests.
- Additionally, previews for the URL, payload, and response are provided with the possibility to copy them so users can use them directly.

Please log in to comment on this module