Summary of the previous episodes: On December 25th 2015, Akretion developed the import of regular PDF invoices via the use of the invoice2data library. This solution requires the development of an invoice import template for each supplier. This invoice template must be updated when the layout of the invoice is changed by the supplier, which is a major drawback. Akretion's customers discovered this drawback a few weeks after the deployment of the solution in production: as Akretion upgraded its Odoo server from v7 with the Webkit reporting engine to Odoo v8 with the Qweb reporting engine, the layout of Akretion's invoices changed and the import of Akretion's invoices was broken because Akretion's invoice template required an update.
The solution to overcome this drawback was to switch to electronic invoicing. A few months later, in March 2016, Akretion announced the support of the generation of ZUGFeRD invoices. A ZUGFeRD invoice is a PDF invoice with an embedded XML file in Cross Industry Invoice (CII) format. ZUGFeRD is the official electronic invoice format for Germany. Akretion's contribution also featured the support of the import of UBL (Universal Business Language) invoices, which is used by several countries in Northern Europe and is also the basis of the e-fff format used in Belgium. Since April 2016, Akretion France's invoices are ZUGFeRD compliant and Akretion's customers can import them into Odoo thanks to the account_invoice_import_zugferd module. Using the ZUGFeRD format for Akretion's invoices was a nice move... but the benefit for Akretion's customers was still limited.
On January 1st 2015, Akretion rolled out in production Odoo v8 at the Barroux Abbey. On May 1st 2015, the Randol abbey deployed Odoo v8 in production and on January 1st 2016 the La Garde monastery also adopted Odoo v8. Each abbey has a retail shop that sells the production of the monks and also the home-made products of other abbeys (along with books, CDs, religious items, etc.). The honey and sandals produced by the La Garde monastery are sold at the Barroux abbey for instance; the nougat and the biscuits produced by the Barroux abbey are sold both at the Randol abbey and at the La Garde monastery, etc. When the development on ZUGFeRD invoices was completed, I suggested the monk in charge of the finances at the Barroux abbey that he deploy the module to generate ZUGFeRD invoices on the Odoo server of the abbey. That way, the Randol abbey and the La Garde monastery would be able to import the invoices of the Barroux abbey into their Odoo ERP without manual encoding, saving time for more important things. But the answer of the monk wasn't the one I expected: he told me that, as a draft supplier invoice is automatically generated from the purchase order, there was no real benefit in using electronic invoices! The real benefit would be to use electronic orders instead...
So I decided to continue the development to support electronic orders! I started to look for the best solution for electronic orders. I wanted to keep the great idea of the ZUGFeRD standard to have PDF documents with an embedded XML file. But which format was best suited to describe an order in XML? I found out that UBL (Universal Business Language) was the best format for the job. The UBL standard is both simple and accurate. It became the ISO/IEC 19845 standard in December 2015 (cf. the official announcement). UBL is already widely adopted for electronic invoices throughout Northern Europe, in Belgium (the e-fff standard), in Turkey (UBL-TR format) and in Australia. In France, EDF, the national electricity company, already offers to send its invoices in UBL format (cf. their specifications). The UBL standard supports the XML encoding of many different business documents: not only orders and invoices but also product catalogues, requests for quotations, quotations, packing lists, waybills, certificates of origin, etc.
Today, Akretion announces the availability of an UBL stack for Odoo to manage purchase and sale orders in Odoo:
- the module purchase_order_ubl embeds a request for quotation (RFQ) UBL XML file inside each RFQ PDF file generated by Odoo.
- the module sale_order_import_ubl imports UBL RFQ XML files (or the PDF file with an embedded XML file) to generate new quotations.
- the module sale_order_ubl embeds a quotation UBL XML file inside each PDF quotation file.
- the module purchase_order_import_ubl imports quotations to update prices and/or quantities on RFQs.
- when the purchase order is approved in Odoo, the module purchase_order_ubl embeds an order UBL XML file inside the PDF file of the purchase order.
- the module sale_order_import_ubl imports UBL order XML files to update the quotations (or create new quotations).
- when the order is accepted and the sale order is confirmed in Odoo, the module sale_order_ubl will embed an order simple response UBL XML file in the order acknowledgment PDF file of Odoo.
At the end of the sale workflow, when the goods have been successfully shipped, the supplier can generate a ZUGFeRD invoice with the account_invoice_zugferd module; this e-invoice will be used by the customer to update the draft supplier invoice generated by Odoo. For the payment, the SEPA modules of the Odoo Community Association can be used by the customer to generate a SEPA credit transfer XML file (with the module account_banking_sepa_credit_transfer) or by the supplier to generate a SEPA direct debit file (with the module account_banking_sepa_direct_debit).
This process is illustrated in the diagram below:
Please watch this screencast (19 minutes long, 141 MB; or watch in lower-quality on Youtube) that shows a demo of a procurement workflow between a supplier and a customer from RFQ to invoice. With this screencast, you will understand all the benefits of Odoo's UBL and ZUGFeRD stacks developed by Akretion.
The support of electronic orders and electronic invoices with the ZUGFeRD and UBL standards in Odoo uses 23 OCA (Odoo Community Association) modules located in 5 different OCA projects:
- the account invoicing project (pull request under review),
- the sale workflow project (pull request under review),
- the purchase workflow project (pull request under review),
- the community data files project,
- the partner contact project.
These modules use the new API of Odoo and most of them have an automated test suite. These modules are for Odoo v8 but they are easy to port to Odoo v9 or v10.
The Barroux abbey, the Randol abbey and the La Garde monastery will be the first users of these modules to exchange orders and invoices. Their feedback will be essential to fine-tune the UBL stack of Odoo.
After this first deployment, the next step will be to test the interoperability of Odoo's UBL stack with other ERPs. According to this blog post, Oracle, SAP and Microsoft ERP solutions now support UBL natively or via third-party add-ons.
Alexis de Lattre, who developed the UBL stack of Odoo, says: 'The development of the UBL stack of Odoo is probably my biggest opensource contribution ever! I am very enthusiastic about the potential of UBL-based electronic orders and electronic invoices for B2B transactions. I hope that we won't have to wait for too long before having embedded UBL XML files in most PDF orders and PDF invoices!'
This opensource contribution is brought to you by Akretion for free under the AGPL licence. Don't hesitate to give your feedback on the pull requests under review on Github. If you have some real-life UBL orders or invoices, we would be grateful if you could share a copy with us so that we can enhance our knowledge of the UBL standard and fine-tune Odoo's UBL stack (we will keep these files confidential unless you give us an explicit authorization to publish them).