[IMP] Export: Updated quotations template for order lines

closes odoo/documentation#15537

X-original-commit: 7fdeabaefc
Signed-off-by: Megan Valenzuela (meval) <meval@odoo.com>
This commit is contained in:
meval1006​
2025-11-25 21:53:08 +00:00
parent 63adac0af8
commit 9d0c5f6e41
8 changed files with 79 additions and 78 deletions

View File

@@ -2,9 +2,6 @@
Export and import data Export and import data
====================== ======================
.. |list| replace:: :icon:`oi-view-list` :guilabel:`(list)` icon
.. |actions| replace:: :icon:`fa-cog` :guilabel:`Actions`
In Odoo, it is sometimes necessary to export or import data for running reports, or for data In Odoo, it is sometimes necessary to export or import data for running reports, or for data
modification. This document covers the export and import of data into and out of Odoo. modification. This document covers the export and import of data into and out of Odoo.
@@ -19,19 +16,20 @@ Export data from Odoo
===================== =====================
When working with a database, it is sometimes necessary to export data in a distinct file. Doing so When working with a database, it is sometimes necessary to export data in a distinct file. Doing so
can aid in reporting on activities, although, Odoo provides a precise and easy reporting tool with can aid in reporting on activities, although, Odoo provides a precise reporting tool with each
each available application. available application.
With Odoo, the values can be exported from any field in any record. To do so, activate the list view With Odoo, the values can be exported from any field in any record. To do so, activate the list view
(|list|), on the items that need to be exported, then select the records that should be exported. To :icon:`fa-list` :guilabel:`(List)` icon, on the items that need to be exported, and then select the
select a record, tick the checkbox next to the corresponding record. Finally, click on |actions|, records that should be exported. To select a record, tick the checkbox next to the corresponding
then :guilabel:`Export`. record. Finally, click the :guilabel:`Action` button, and select :icon:`fa-upload`
:guilabel:`Export`.
.. image:: export_import_data/list-view-export.png .. image:: export_import_data/list-view-export.png
:alt: View of the different things to enable/click to export data. :alt: View of the different things to enable/click to export data.
When clicking on :guilabel:`Export`, an :guilabel:`Export Data` pop-over window appears, with When clicking on :icon:`fa-upload` :guilabel:`Export`, a :guilabel:`Export Data` pop-over window
several options for the data to export: appears, with several options for the data to export:
.. image:: export_import_data/export-data-overview.png .. image:: export_import_data/export-data-overview.png
:alt: Overview of options to consider when exporting data in Odoo. :alt: Overview of options to consider when exporting data in Odoo.
@@ -39,27 +37,27 @@ several options for the data to export:
#. With the :guilabel:`I want to update data (import-compatable export)` option ticked, the system #. With the :guilabel:`I want to update data (import-compatable export)` option ticked, the system
only shows the fields that can be imported. This is helpful in the case where the :ref:`existing only shows the fields that can be imported. This is helpful in the case where the :ref:`existing
records need to be updated <essentials/update-data>`. This works like a filter. Leaving the box records need to be updated <essentials/update-data>`. This works like a filter. Leaving the box
unticked, gives many more field options because it shows all the fields, not just the ones that unticked, gives many more field options because it shows all the fields, not only the ones that
can be imported. can be imported.
#. When exporting, there is the option to export in two formats: `.csv` and `.xls`. With `.csv`, #. When exporting, there is the option to export in two formats: `.csv` and `.xls`. With `.csv`,
items are separated by a comma, while `.xls` holds information about all the worksheets in a items are separated by a comma, while `.xls` holds information about all the worksheets in a
file, including both content and formatting. file, including both content and formatting.
#. These are the items that can be exported. Use the :guilabel:`> (right arrow)` icon to display #. These are the items that can be exported. Use the :icon:`fa-chevron-right` :guilabel:`(Show
more sub-field options. Use the :guilabel:`Search` bar to find specific fields. To use the sub-fields)` icon to display more sub-field options. Use the :guilabel:`Search` bar to find
:guilabel:`Search` option more efficiently, click on all the :guilabel:`> (right arrows)` to specific fields. To use the :guilabel:`Search` option more efficiently, click on all the
display all fields. :icon:`fa-chevron-right` :guilabel:`(Show sub-fields)` icon to display all fields.
#. The :guilabel:`+ (plus sign)` icon button is present to add fields to the :guilabel:`Fields to #. The :icon:`fa-plus` :guilabel:`(Select field)` icon button is present to add fields to the
export` list. :guilabel:`Fields to export` list.
#. The :guilabel:`↕️ (up-down arrow)` to the left of the selected fields can be used to move the #. The :icon:`fa-sort` :guilabel:`(Sort)` icon to the left of the selected fields can be used to
fields up and down, to change the order in which they are displayed in the exported file. move the fields up and down, to change the order in which they are displayed in the exported
Drag-and-drop using the :guilabel:`↕️ (up-down arrow)` icon. file. Drag-and-drop using the :icon:`fa-sort` :guilabel:`(Sort)` icon.
#. The :guilabel:`🗑️ (trash can)` icon is used to remove fields. Click on the :guilabel:`🗑️ (trash #. The :icon:`fa-trash` :guilabel:`(Remove field)` icon is used to remove fields. Click the
can)` icon to remove the field. :icon:`fa-trash` :guilabel:`(Remove field)` icon to remove the field.
#. For recurring reports, it is helpful to save export presets. Select all the needed fields, and #. For recurring reports, it is helpful to save export presets. Select all the needed fields, and
click on the template drop-down menu. Once there, click on :guilabel:`New template`, and give a click on the template drop-down menu. Once there, click on :guilabel:`New template`, and give a
unique name to the export just created. Click the :guilabel:`💾 (floppy drive)` icon to save the unique name to the export template. Click the :icon:`fa-floppy-o` :guilabel:`(floppy drive)` icon
configuration. The next time the same list needs to be exported, select the related template that to save the configuration. The next time the same list needs to be exported, select the related
was previously saved from the drop-down menu. template that was previously saved from the drop-down menu.
.. tip:: .. tip::
It is helpful to know the field's external identifier. For example, :guilabel:`Related Company` It is helpful to know the field's external identifier. For example, :guilabel:`Related Company`
@@ -102,18 +100,19 @@ Data can be imported on any Odoo business object using either Excel (`.xlsx`) or
(Comma-separated Values)` (`.csv`) formats. This includes: contacts, products, bank statements, (Comma-separated Values)` (`.csv`) formats. This includes: contacts, products, bank statements,
journal entries, and orders. journal entries, and orders.
Open the view of the object to which the data should be imported/populated, click the :icon:`fa-cog` Open the view of the object to which the data should be imported/populated, click on :icon:`fa-cog`
(:guilabel:`gear`) icon and select :guilabel:`Import records`. :guilabel:`(Action)` icon, and in the drop-down menu select :icon:`fa-upload` :guilabel:`(Import
records)`.
.. image:: export_import_data/import-button.png .. image:: export_import_data/import-button.png
:alt: Action menu revealed with the import records option highlighted. :alt: Action menu revealed with the import records option highlighted.
Click :icon:`fa-download`:guilabel:`Import Template for Customers` at the center of the page to Click :icon:`fa-upload`:guilabel:`Import Template for Customers` at the center of the page to
download a :ref:`template <essentials/export_import_data/adapt-a-template>` and populate it with download a :ref:`template <essentials/export_import_data/adapt-a-template>` and populate it with the
the company's own data. Such templates can be imported in one click since the data mapping is company's own data. Such templates can be imported in one click since the data mapping is already
already preconfigured. preconfigured.
To upload the downloaded template or your own file, follow the next steps: To upload the downloaded template or an existing file, follow the next steps:
#. Click :guilabel:`Upload Data File` and select the desired file. #. Click :guilabel:`Upload Data File` and select the desired file.
#. Adjust the :guilabel:`Formatting` options as needed (for CSV files only). #. Adjust the :guilabel:`Formatting` options as needed (for CSV files only).
@@ -152,15 +151,15 @@ Once the template is downloaded, proceed to follow these steps:
fit any field within Odoo. However, new columns can be mapped manually when the import is tested. fit any field within Odoo. However, new columns can be mapped manually when the import is tested.
Search the drop-down menu for the corresponding field. Search the drop-down menu for the corresponding field.
.. image:: export_import_data/field_list.png .. image:: export_import_data/field-list.png
:alt: Drop-down menu expanded in the initial import screen on Odoo. :alt: Drop-down menu expanded in the initial import screen on Odoo.
Then, use this field's label in the import file to ensure future imports are successful. Then, use this field's label in the import file to ensure future imports are successful.
.. tip:: .. tip::
Another useful way to find out the proper column names to import is to export a sample file Another useful way to find out the proper column names to import is to export a sample file using
using the fields that should be imported. This way, if there is not a sample import template, the fields to be imported. This way, if there is not a sample import template, the names are
the names are accurate. accurate.
.. _essentials/external-id: .. _essentials/external-id:
@@ -168,8 +167,8 @@ Once the template is downloaded, proceed to follow these steps:
Import from another application Import from another application
------------------------------- -------------------------------
The :guilabel:`External ID` (ID) is a unique identifier for the line item. Feel free to use one The :guilabel:`External ID` (ID) is a unique identifier for a line item. It is possible to use an
from previous software to facilitate the transition to Odoo. :guilabel:`External ID` (ID) from previous software to facilitate the transition to Odoo.
Setting an ID is not mandatory when importing, but it helps in many cases: Setting an ID is not mandatory when importing, but it helps in many cases:
@@ -201,7 +200,7 @@ the column may be mapped to a field that is not proposed by default.
If this happens, check the :guilabel:`Show fields of relation fields (advanced) option`, then a If this happens, check the :guilabel:`Show fields of relation fields (advanced) option`, then a
complete list of fields becomes available for each column. complete list of fields becomes available for each column.
.. image:: export_import_data/field_list.png .. image:: export_import_data/field-list.png
:alt: Searching for the field to match the tax column. :alt: Searching for the field to match the tax column.
Change data import format Change data import format
@@ -224,7 +223,7 @@ the preferred format using *ISO 8601* to define the format.
.. important:: .. important::
*ISO 8601* is an international standard, covering the worldwide exchange, along with the *ISO 8601* is an international standard, covering the worldwide exchange, along with the
communication of date and time-related data. For example, the date format should be `YYYY-MM-DD`. communication of date and time-related data. For example, the date format should be `YYYY-MM-DD`.
So, in the case of July 24th 1981, it should be written as `1981-07-24`. In the case of July 24th 1981, it should be written as `1981-07-24`.
.. tip:: .. tip::
When importing Excel files (`.xls`, `.xlsx`), consider using *date cells* to store dates. This When importing Excel files (`.xls`, `.xlsx`), consider using *date cells* to store dates. This
@@ -371,7 +370,7 @@ The tags should be separated by a comma, without any spacing. For example, if a
linked to both tags: `Manufacturer` and `Retailer` then 'Manufacturer,Retailer' needs to be encoded linked to both tags: `Manufacturer` and `Retailer` then 'Manufacturer,Retailer' needs to be encoded
in the same column of the :abbr:`CSV (Comma-separated Values)` file. in the same column of the :abbr:`CSV (Comma-separated Values)` file.
- :download:`CSV file for Manufacturer, Retailer <export_import_data/m2m_customers_tags.csv>` - :download:`CSV file for Manufacturer, Retailer <export_import_data/m2m-customers-tags.csv>`
Import one2many relationships Import one2many relationships
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -381,33 +380,34 @@ reserved in the :abbr:`CSV (Comma-separated Values)` file for each order line. T
is imported on the same row as the information relative to order. Any additional lines need an is imported on the same row as the information relative to order. Any additional lines need an
additional row that does not have any information in the fields relative to the order. additional row that does not have any information in the fields relative to the order.
As an example, here is a :abbr:`CSV (Comma-separated Values)` file of some quotations that can be .. example::
imported, based on demo data: A company imports quotations using a :abbr:`CSV (Comma-separated Values)` file, based on demo
data:
- :download:`File for some Quotations - :download:`File for some quotations <export_import_data/o2m-quotations-order-lines.csv>`
<export_import_data/purchase.order_functional_error_line_cant_adpat.csv>`
The following :abbr:`CSV (Comma-separated Values)` file shows how to import purchase orders with A company imports purchase orders with their respective purchase order lines using a :abbr:`CSV
their respective purchase order lines: (Comma-separated Values)` file:
- :download:`Purchase orders with their respective purchase order lines - :download:`Purchase orders with their respective purchase order lines
<export_import_data/o2m_purchase_order_lines.csv>` <export_import_data/o2m-purchase-order-lines.csv>`
The following :abbr:`CSV (Comma-separated Values)` file shows how to import customers and their A company imports customers and their respective contacts using a :abbr:`CSV (Comma-separated
respective contacts: Values)` file:
- :download:`Customers and their respective contacts - :download:`Customers and their respective contacts
<export_import_data/o2m_customers_contacts.csv>` <export_import_data/o2m-customers-contacts.csv>`
Import image files Import image files
------------------ ------------------
To import image files along with the :ref:`uploaded <essentials/export_import_data/get-started>` To import image files along with the :ref:`uploaded <essentials/export_import_data/get-started>` CSV
CSV or Excel file, follow the next steps: or Excel file, follow the next steps:
#. Add the image file names to the relevant :guilabel:`Image` column in the data file. #. Add the image file names to the relevant :guilabel:`Image` column in the data file.
#. :ref:`Upload the data file <essentials/export_import_data/get-started>` or reload it by #. :ref:`Upload the data file <essentials/export_import_data/get-started>` or reload it by clicking
clicking :guilabel:`Load Data File`. :guilabel:`Load Data File`.
#. Click :guilabel:`Upload your files` under the :guilabel:`Files to import` section. #. Click :guilabel:`Upload your files` under the :guilabel:`Files to import` section.
#. Select the relevant image files. The number of files selected appears next to the button. #. Select the relevant image files. The number of files selected appears next to the button.
#. Click :guilabel:`Test` to verify that all data is valid. #. Click :guilabel:`Test` to verify that all data is valid.
@@ -416,15 +416,16 @@ CSV or Excel file, follow the next steps:
imported without any image. imported without any image.
.. note:: .. note::
- The :guilabel:`Files to import` section is enabled if your product template has an
- The :guilabel:`Files to import` section is enabled if the product template has an
:guilabel:`Image` column with all fields populated. :guilabel:`Image` column with all fields populated.
- The image file names in the data file must correspond to the uploaded image files. - The image file names in the data file must correspond to the uploaded image files.
- When importing a large number of images, you can specify the maximum batch size in megabytes - When importing a large number of images, specify the maximum batch size in megabytes and set a
and set a delay to prevent the system from becoming overloaded. To do so, :doc:`enable the delay to prevent the system from becoming overloaded. To do so, :doc:`enable the developer mode
developer mode <../general/developer_mode>` and fill in the :guilabel:`Max size per <../general/developer_mode>` and fill in the :guilabel:`Max size per batch` and the
batch` and the :guilabel:`Delay after each batch` fields in the :guilabel:`Files to import` :guilabel:`Delay after each batch` fields in the :guilabel:`Files to import` section. By
section. By default, the delay meets the RPC/API call limit defined in the `Odoo Cloud - default, the delay meets the RPC/API call limit defined in the `Odoo Cloud - Acceptable Use
Acceptable Use Policy <https://www.odoo.com/acceptable-use>`_. Policy <https://www.odoo.com/acceptable-use>`_.
Import records several times Import records several times
---------------------------- ----------------------------
@@ -443,8 +444,8 @@ Value not provided for a specific field
--------------------------------------- ---------------------------------------
If all fields are not set in the CSV file, Odoo assigns the default value for every non-defined If all fields are not set in the CSV file, Odoo assigns the default value for every non-defined
field. But, if fields are set with empty values in the :abbr:`CSV (Comma-separated Values)` file, field. However, if fields are set with empty values in the :abbr:`CSV (Comma-separated Values)`
Odoo sets the empty value in the field, instead of assigning the default value. file, Odoo sets the empty value in the field, instead of assigning the default value.
Export/import different tables from an SQL application to Odoo Export/import different tables from an SQL application to Odoo
-------------------------------------------------------------- --------------------------------------------------------------
@@ -505,8 +506,8 @@ the original database).
The two files produced are ready to be imported in Odoo without any modifications. After having The two files produced are ready to be imported in Odoo without any modifications. After having
imported these two :abbr:`CSV (Comma-separated Values)` files, there are four contacts and three imported these two :abbr:`CSV (Comma-separated Values)` files, there are four contacts and three
companies (the first two contacts are linked to the first company). Keep in mind to first import companies (the first two contacts are linked to the first company). Keep in mind to first import the
the companies, and then the people. companies, and then the people.
.. _essentials/update-data: .. _essentials/update-data:
@@ -519,10 +520,10 @@ Existing data can be updated in bulk through a data import, as long as the :ref:
Prepare data export Prepare data export
------------------- -------------------
To update data through an import, first navigate to the data to be updated, and select the |list| to To update data through an import, first navigate to the data to be updated, and select the
activate list view. On the far-left side of the list, tick the checkbox for any record to be :icon:`oi-view-list` :guilabel:`(List)` icon to activate list view. On the far-left side of the
updated. Then, click |actions|, and select :icon:`fa-upload` :guilabel:`Export` from the drop-down list, tick the checkbox for any record to be updated. Then, click :guilabel:`Actions` button, and
menu. select :icon:`fa-upload` :guilabel:`Export` from the drop-down menu.
On the resulting :guilabel:`Export Data` pop-up window, tick the checkbox labeled, :guilabel:`I want On the resulting :guilabel:`Export Data` pop-up window, tick the checkbox labeled, :guilabel:`I want
to update data (import-compatible export)`. This automatically includes the *External ID* in the to update data (import-compatible export)`. This automatically includes the *External ID* in the

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,6 @@
Activities,Company,Customer,Order Date,Order Reference,Pricelist,Order Lines/Product Template,Order Lines/Quantity,Order Lines/Unit Price,Order Lines/Discount (%),Order Lines/Taxes
Answer questions,My Company (San Francisco),Ready Mat,2025-12-01 10:37:22,S00003,Public Pricelist (USD),Virtual Interior Design,10,30.75,0,Tax 10%
,,,,,,[FURN_7777] Office Chair,1,70,0,Tax 10%
,,,,,,Deposit,5,150,0,
,My Company (San Francisco),Ready Mat,2025-11-01 11:37:00,S00002,Public Pricelist (USD),Virtual Interior Design,24,75,0,Tax 10%
,,,,,,Virtual Home Staging,30,38.25,0,Tax 10%
1 Activities Company Customer Order Date Order Reference Pricelist Order Lines/Product Template Order Lines/Quantity Order Lines/Unit Price Order Lines/Discount (%) Order Lines/Taxes
2 Answer questions My Company (San Francisco) Ready Mat 2025-12-01 10:37:22 S00003 Public Pricelist (USD) Virtual Interior Design 10 30.75 0 Tax 10%
3 [FURN_7777] Office Chair 1 70 0 Tax 10%
4 Deposit 5 150 0
5 My Company (San Francisco) Ready Mat 2025-11-01 11:37:00 S00002 Public Pricelist (USD) Virtual Interior Design 24 75 0 Tax 10%
6 Virtual Home Staging 30 38.25 0 Tax 10%

View File

@@ -1,6 +0,0 @@
"Order Reference","Supplier","Destination","Pricelist","Order Lines / Product","Order Lines / Quantity"
"PO000020","ASUSTeK","Stock","Default Purchase Pricelist","ADPT",20
,,,,"CARD",30
,,,,"C-Case",40
"PO000021","Axelor","Stock","Default Purchase Pricelist","CD",5
,,,,"CPUa8",15
1 Order Reference Supplier Destination Pricelist Order Lines / Product Order Lines / Quantity
2 PO000020 ASUSTeK Stock Default Purchase Pricelist ADPT 20
3 CARD 30
4 C-Case 40
5 PO000021 Axelor Stock Default Purchase Pricelist CD 5
6 CPUa8 15