[ADD] purchase: edi

closes odoo/documentation#12791

Signed-off-by: Felicia Kuan (feku) <feku@odoo.com>
Co-authored-by: Jess Rogers <104637850+jero-odoo@users.noreply.github.com>
Co-authored-by: Zachary Straub <zst@odoo.com>
Co-authored-by: Sam Lieber (sali) <36018073+samueljlieber@users.noreply.github.com>
This commit is contained in:
Felicious
2025-03-25 14:59:08 -07:00
parent 113adee4a1
commit 797920d4d1
8 changed files with 221 additions and 2 deletions

View File

@@ -10,3 +10,4 @@ Advanced
advanced/analyze
advanced/vendor_costs_report
advanced/procurement_expenses_report
advanced/edi

View File

@@ -0,0 +1,113 @@
==================================
EDI purchase-to-sales order import
==================================
.. |EDI| replace:: :abbr:`EDI (Electronic Data Exchange)`
.. |PO| replace:: :abbr:`PO (purchase order)`
.. |SO| replace:: :abbr:`SO (sales order)`
Electronic data interchange (EDI) enables companies using different software systems to exchange
information in a standardized, structured format.
In Odoo, a *purchase order* (PO) can be exported as an XML file and imported as a *sales order* (SO)
into another Odoo database, removing the need for manual entry of products, quantities, prices, and
other key information.
.. note::
Exported XMLs follow the `Order-X schema <https://fnfe-mpe.org/factur-x/order-x/>`_, a standard
commonly used in European countries. When exchanging data between two Odoo databases, this schema
remains compatible.
However, implementing custom developments for software that does not support the Order-X schema
may introduce additional complexity.
Roles and configuration
=======================
To facilitate the |EDI| workflow, two companies are involved: the buyer (the company placing the
order) and the seller (the company fulfilling the order). Each company has specific roles and
configurations.
Buyer database
--------------
The buyer database is responsible for creating and confirming purchase orders. Prerequisites include
:ref:`installing <general/install>` the **Purchase** app and adding vendors (the sellers in this
workflow) as :doc:`portal users <../../../general/users/portal>`.
Seller database
---------------
The seller database is responsible for receiving and processing sales orders. The only prerequisite
is :ref:`installing <general/install>` the **Sales** app.
Workflow
========
Buyer's process
---------------
To begin, the buyer (in their database) navigates to the :menuselection:`Purchase` app to create a
request for quotation (RFQ).
Set the :guilabel:`Vendor` to the portal user representing the seller, and :guilabel:`Confirm` the
:abbr:`RFQ (request for quotation)`. Doing so converts it into a :doc:`purchase order
<../manage_deals/rfq>`.
.. example::
|PO| from the buyer's database. The :guilabel:`Vendor` is the seller's portal user account, Joel.
.. image:: edi/po-database-view.png
:alt: Example PO. The Vendor is the seller's portal user account, Joel.
Seller's process
----------------
Once the |PO| is confirmed, it appears on the seller's portal dashboard. The seller downloads the
XML file and uploads it to their database.
Download file
~~~~~~~~~~~~~
As the seller, log in to the buyer's database as the portal user. On the dashboard, scroll down and
click the :guilabel:`Our Orders` button. Doing so reveals a list of purchase orders the buyer's
database has addressed to the portal user.
Select the desired purchase order, and the click :guilabel:`Connect with your software!` button.
In the pop-up window, copy the provided URL, and paste it into a new browser tab to download the XML
file.
.. example::
Joel's portal view of the PO. The first image displays the :guilabel:`Connect with your
software!` button, and the second image displays a pop-up window with the :guilabel:`Copy`
button.
.. image:: edi/po-portal-view.png
:alt: Portal view of the PO, with "Connect your software!" button.
.. image:: edi/pop-up.png
:alt: Pop-up to copy link.
.. example::
:download:`XML file <edi/P00017.xml>` for PO00017
Upload file
~~~~~~~~~~~
Next, the seller logs in to their own Odoo database and opens :menuselection:`Sales` app. Click
:guilabel:`Upload` and select the downloaded XML file. Alternatively, users can drag and drop the
file into the :guilabel:`Quotations` dashboard.
Doing so automatically generates a sales order with the customer populated as the buyer and all
product lines, quantities, and prices pre-filled. This process ensures efficient and accurate data
exchange between the two databases.
.. figure:: edi/so.png
:alt: Uploaded SO in the seller's database.
Uploaded SO in the seller's database.
.. seealso::
:doc:`../../../sales/sales/sales_quotations/create_quotations`

View File

@@ -0,0 +1,107 @@
<?xml version='1.0' encoding='UTF-8'?>
<Order xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:CustomizationID data-oe-model="ir.ui.view" data-oe-id="4828" data-oe-field="arch" data-oe-xpath="/t[1]/{urn:oasis:names:specification:ubl:schema:xsd:Order-2}Order[1]/{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}CustomizationID[1]">urn:fdc:peppol.eu:poacc:trns:order:3</cbc:CustomizationID>
<cbc:ProfileID data-oe-model="ir.ui.view" data-oe-id="4828" data-oe-field="arch" data-oe-xpath="/t[1]/{urn:oasis:names:specification:ubl:schema:xsd:Order-2}Order[1]/{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}ProfileID[1]">urn:fdc:peppol.eu:poacc:bis:ordering:3</cbc:ProfileID>
<cbc:ID>P00017</cbc:ID>
<cbc:IssueDate>2025-04-03</cbc:IssueDate>
<cbc:DocumentCurrencyCode>USD</cbc:DocumentCurrencyCode>
<cac:BuyerCustomerParty>
<cac:Party>
<cac:PartyName>
<cbc:Name>JEBAĆ TUSKA</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>1034 Wildwood Street</cbc:StreetName>
<cbc:CityName>Millersburg</cbc:CityName>
<cbc:PostalZone>44654</cbc:PostalZone>
<cbc:CountrySubentity>Ohio</cbc:CountrySubentity>
<cac:Country>
<cbc:IdentificationCode>US</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:Contact>
<cbc:Name>JEBAĆ TUSKA</cbc:Name>
<cbc:Telephone>+1 555-555-5556</cbc:Telephone>
<cbc:ElectronicMail>info@yourcompany.com</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
</cac:BuyerCustomerParty>
<cac:SellerSupplierParty>
<cac:Party>
<cac:PartyName>
<cbc:Name>YourCompany, Joel Willis</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>858 Lynn Street</cbc:StreetName>
<cbc:CityName>Bayonne</cbc:CityName>
<cbc:PostalZone>07002</cbc:PostalZone>
<cbc:CountrySubentity>New Jersey</cbc:CountrySubentity>
<cac:Country>
<cbc:IdentificationCode>US</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:Contact>
<cbc:Name>Joel Willis</cbc:Name>
<cbc:Telephone>(683)-556-5104</cbc:Telephone>
<cbc:ElectronicMail>joel.willis63@example.com</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
</cac:SellerSupplierParty>
<cac:Delivery>
<cac:DeliveryParty>
<cac:PartyName>
<cbc:Name>JEBAĆ TUSKA</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>1034 Wildwood Street</cbc:StreetName>
<cbc:CityName>Millersburg</cbc:CityName>
<cbc:PostalZone>44654</cbc:PostalZone>
<cbc:CountrySubentity>Ohio</cbc:CountrySubentity>
<cac:Country>
<cbc:IdentificationCode>US</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:Contact>
<cbc:Name>JEBAĆ TUSKA</cbc:Name>
<cbc:Telephone>+1 555-555-5556</cbc:Telephone>
<cbc:ElectronicMail>info@yourcompany.com</cbc:ElectronicMail>
</cac:Contact>
</cac:DeliveryParty>
</cac:Delivery>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="USD">7.5</cbc:TaxAmount>
</cac:TaxTotal>
<cac:AnticipatedMonetaryTotal>
<cbc:LineExtensionAmount currencyID="USD">50.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="USD">50.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="USD">57.50</cbc:TaxInclusiveAmount>
<cbc:PayableAmount currencyID="USD">57.50</cbc:PayableAmount>
</cac:AnticipatedMonetaryTotal>
<cac:OrderLine>
<cac:LineItem>
<cbc:ID>1</cbc:ID>
<cbc:Quantity unitCode="C62">5.0</cbc:Quantity>
<cbc:LineExtensionAmount currencyID="USD">50.0</cbc:LineExtensionAmount>
<cac:Price>
<cbc:PriceAmount currencyID="USD">10.0</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
</cac:Price>
<cac:Item>
<cbc:Name>Office Lamp</cbc:Name>
<cbc:Description>Office Lamp</cbc:Description>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>15.0</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
</cac:LineItem>
</cac:OrderLine>
</Order>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -2,8 +2,6 @@
Requests for quotation
======================
.. _purchase/manage_deals/rfq:
.. |PO| replace:: :abbr:`PO (Purchase Order)`
.. |POs| replace:: :abbr:`POs (Purchase Orders)`
.. |RFQ| replace:: :abbr:`RFQ (Request for Quotation)`