Community
Enterprise

EDI - FTP Import/Export Records

Overview

This module integrates with FTP servers to retrieve folder structures and create file attachments, allowing seamless file management within Odoo. It supports importing and exporting various data, facilitating efficient data transfer to and from Odoo.

Integration Steps

Installation

  • After downloading the Odoo EDI Integration App from the Odoo store, place it in the Odoo Addons path or any desired location. Restart your Odoo instance and go to the Apps section in the dashboard. Click on "Update Apps List" from the menu. Once the list is updated successfully, the Odoo EDI Integration app will appear in the Apps section.
  • Click the "Install" button, and you're all set! You can now use the Odoo EDI Integration app in your Odoo instance.
  • Log in to apps.odoo.com (from the account you purchased the app)
  • Download the latest version of your purchased app.
  • Extract the zip and replace the folder with existing add-ons (EDI/FTP Odoo Integration)
  • 3.1 For Odoo.sh, Push the changes to the GitHub repository.
  • Restart the Odoo service. (Only for Odoo On-Premise)
  • Go to Apps ↣ EDI/FTP Odoo Connector ↣ Upgrade

FTP Configuration (From menu FTP Syncing)

You need to set up FTP syncing connection by entering the FTP URL, port, username, and password.

After entering the proper details, the right-side ribbon indicates whether your FTP connection is properly configured or not.

Fetch Directories from FTP

After successfully syncing with FTP, you will see the 'Sync FTP Directories' button. Clicking this button will fetch the directories from FTP and create corresponding records in Odoo.

EDI Table integration (From EDI menu)

You need to mention the required details for the incoming/outgoing table.
  • Odoo model: Which Odoo model would you like to perform the operation on?
  • XML Header: You need to specify the main header name in the XML.
  • Search record from this value: To check an existing record, you need to enter the XML tag associated with that value.
  • Default value: During the import/export process, if you want to include specific values along with the processed data, you should enter these values in dictionary format.
  • Type: Incoming/Outgoing, this table will be used for which kind of operation.
  • Trading Partner: When the type is outgoing, you need to select the trading partner/contact from which records of the particular model will be fetched and then exported to FTP.
  • Export file to FTP Directory: When the type is outgoing, you need to select the FTP directory where you want to export files.
  • Main table: You need to enable this option if your configuration is main. For example, to add a sale order record, create a configuration record with the main table option enabled for the sale order model. Additionally, create a separate configuration for the sale order line without enabling the main table option.
In Mapping XML Elements with Fields table
  • XML Element: You need to enter the exact XML element you want to map with the Odoo field.
  • Selected Model fields: You need to select the field with which you want to map the XML data.
  • Field to search for M2O: This field is optional. If you choose a Many2one field for mapping, you have the option to set the inner field of that Many2one model. This helps you search records based on that field; otherwise, the search will use the name field of the Many2one model.
  • Sub EDI Import Table: For a One2Many field, you need to select a subtable where a separate configuration is available for the One2Many fields.

    (In the subtable, follow the same concept, but you do not need to enable the Main table option. If the "Search record from this value" field is left empty, it will create duplicate One2Many records from the CSV. If you select this option, it will update existing records.)

  • Required: When the type is outgoing, this field becomes visible. If it's enabled, the element is required and will cause an error if the value is missing.
  • Character length max: When the type is outgoing, this field becomes visible. This option allows you to limit the number of characters for a field.
Main Table
Sub Table

Import Records Process (From FTP to Odoo)

Fetch Inner files/attachments from directories

First, in the directory list view, specify which directory will be used for the Download operation and which for the Upload operation.

After making these selections, the inner files/attachments from the directories chosen for downloading will be fetched into Odoo, creating Odoo attachments.

Along with FTP attachments, EDI transaction records will also be created. (Those records will be processed when the scheduled action executes.)

Export Records Process (From Odoo to FTP)

A scheduled action has been created to fetch export records based on the EDI Table configuration of the Trading Partner and Odoo Model, which will then create EDI transaction records. (Those records will be processed when the scheduled action executes.)

If something goes wrong or required field values are missing, those EDI transaction records will be set to a failed state, and a log will be generated for them. After rectifying the issue, you can recompute the XML content by clicking the 'Re-compute' button. Upon successful recomputation, the XML content will be available, and the state will change to draft.

To process EDI Transactions through Scheduled Action (Cron)

From the scheduled action, all EDI transactions in the draft state are processed based on the type.

Incoming type: Records will be created in Odoo.

Outgoing type: Records will be exported/uploaded to FTP from Odoo. Based on the configuration table, the XML file will be uploaded to the directory specified in the configuration.

On successful EDI transaction processed that record will move to the done state, if any issue arises then it will move into the failed state & log will generated to check issue.

Scheduled Action

Incoming record created of Sale Order

Incoming record created of Purchase Order

Outgoing record: XML file is generated and exported to the configured FTP directory.

Log management

A log is created for reference in case of any faults during the import/export process.

We also set a scheduled action to delete log records older than 13 days.

Sample XML files

Sample Sale order file which gets imported from FTP.

Sample Purchase Order file which gets imported from FTP.