Firstly, I am not sure if you have located the origin document on Odoo and EDI but if not, take a moment and read this first: https://doc.odoo.com/6.1/de/book/3/3_6/invoice_payment/
The functionality there means that Odoo is able to generate the EDI document every time the invoice is created. It also implies that every time you receive an EDI document you may be able to import it.
There is a bug I have discovered at least on the Online version that shows that it is not possible to simply import EDI documents without some workaround.So depending on your need, there might be a current workaround which I have been discussing with Odoo Support that might also work for you.
In my case, it turns out that the current code base will allow EDI imports automatically if the Belgian Locale is installed in addition to your locale. This is due to the fact that the code is somehow fused in there. We are working on separating and isolating this.
Let me know which of the scenarios you need help with then we can drill in deeper. Generally, EDI documents are generated automatically with every invoice.
Let me also add this link of the Peru Localisation with EDI so you can see to what extend Odoo allows customisation and functionality when it is present: https://www.odoo.com/documentation/user/14.0/accounting/fiscal_localizations/localizations/peru.html
There are many more on the apps.odoo.com for EDI specific solutions, 1038 as I write.
Good luck!