EDI Connector
With All Community Apps Dependencies
Description
This module is configured to enable automated document sending and receiving in XML format between an EDI platform and Odoo.
Setup
- In order to work with EDI along Odoo, we need an FTP setup in our Odoo Instance.
- After setting FTP in our Odoo Instance, We have to configure the EDI trading partner and set the EDI Translation Table in the FTP Directory from which the File should be downloaded in the EDI Data.
Overview of Application
- EDI Data
- EDI Trading partner
- EDI Translation Table
- EDI Inventory report
- Configuration
Setup of EDI Trading Partner
To access the EDI Configurations, we must first set up the EDI trading partner, which is located in the contact’s EDI section.
- EDI Active → If the boolean is selected, then EDI considers it as an EDI trading partner
- EDI Sender ID →Specific Id for the trading partner
- EDI Sender Name → Name used for the EDI trading partner
- EDI Invoice Address →If the Trading partner have a specific invoice address, then we may map it here
- EDI Delivery Address → If the Trading partner have a specific delivery address, then we may map it here
- EDI Inventory Report → Boolean is enabled, then the inventory report is sent at specific period
- EDI Inventory Pricelist → EDI trading partner pricelist
EDI Translation Table
- This is the table that is used to map the EDI Data to corresponding fields of the Model when EDI data is processed.
- There are two types
- Incoming – Set to Table which creates the Record from the EDI Data
- Outgoing – Set to Table which sends the Record as EDI Data
- Odoo Model Reference → The Model for which the Record should be created is set on this field
- Main Process →If Enabled, then it is the main process and if not set, then it is a subprocess.
- EDI Trading Partner Line → Used to select the EDI translation line in which EDI trading partner info is mapped
- Update if Match → Updates the record previously available.
- Default Values → The Default Values for the Record being created are passed in this field as a Dictionary
- Adds the ability to send default value to sub EDI model mapping
- Send File to FTP Folder → The Directory for which the created Record should be uploaded in FTP should be set here
EDI Translation Mapping
The field values of the Record are mapped using this mapping (EDI Translation Table Line) Each line is set with different Parameters.
- XML Element → The Tag from which the data should be taken is set here
- Default value → If set, then it will be set as a default value to the corresponding field
- Odoo Field → The Field in the Model for which the record should be created
- XML Selection Child → If set with a filter created using the data tag, then the data under this filter will only be considered
- XML Data Child → Sets the value for the field given here
- Matching Values → sets the value to the field which is given in the key-value pair.
- Required → If set, then this field is a mandatory field while creating the record
- Search if record already exists →This option allow us to search for existing record in the odoo model of the EDI Translation Table
- Search if record already exists (Partial)→ If set, then this is used to search the values as partial ie: ilike
- Is Multi Element →This option adds the support to add the multiple element for the XMl content
- EDI sub Reference → The Translational Table for which the sub-process is set.
- Trigger Onchange → If set, it will trigger the base on change function of the field set in the odoo field
- Use Field → The Value for the Odoo field from the related model is set here
- Do Not Process Line → Selected translation table line to decide whether the line map is needed or not
- Do Not Process Line result → Checks the result of above for do not process line and if matched then the line will not be processed
- Fields to match → This field allows us to select the EDI Translation table lines defined in order to match/find existing record
EDI Data
- Records are created when we Download from the FTP to the corresponding Translation Table.
- The contents of the Record are automatically filled by code according to the translation table and the corresponding EDI content is filled in the content area.
- After the Creation of EDI Data, we have to process the Data to which it creates a corresponding Record to the model which is set in the Translation Table.
- If the record is already in the Odoo Instance or some data is missing then it will go to the exception state. If there is no exception then it is changed to Done state.
- A Corresponding Record for EDI Document will be created on the model and set in the Related Document field.
- “EDI Trading Partner” in EDI Data is where we can select the Trading Partner.
EDI Flow
After Downloading the file from the remote host, EDI Translation Table will convert the file to EDI Data.
After Processing the data, the corresponding record (eg: SO, PO, etc.) will be created in Odoo.
If we want to upload the data to the remote like Invoice, DO then we have to set the Folder where we should upload the file in the remote by selecting the folder in Send File to FTP Folder in EDI Translation Table
We have specific Automated Actions to upload the data in the remote.
- EDI Invoice Trigger – specific ID
- Delete EDI Reference for EDI Vendor bill
- EDI ASN Trigger – Other Partners
- EDI POA Trigger
- EDI ASN Trigger – specific
- EDI ASN Trigger – Tracking Number Updated After Validation
- EDI Invoice Trigger – Specific
- EDI Invoice Trigger
- EDI Invoice Trigger – Invoice Tag
- EDI ASN Trigger
- EDI 940 Trigger
- EDI 940 Trigger – specific ID
Each Automated Acton will trigger the def _out_process() method in the EDI Translation Table.
Credits