Skip to Content
Menu
This question has been flagged
12 Replies
16744 Views

I want to import into Odoo 13 CE certain data from approximately 800 purchase orders we created in Odoo 12 EE, but have failed at multiple attempts spanning many hours, using various combinations of fields and file formats.

I have a good amount of experience importing data into various editions of Odoo, beginning with Odoo 10, including imports of contacts, products, sales orders, purchase orders, and bank data.

Our goal is to import the following purchase order data into Odoo 13 CE, resulting in the imported POs being in draft RFQ state, ready for confirmation:

  • Order Reference (the "PO number")

  • Order Date

  • Vendor

  • Vendor Reference, if applicable

  • Source Document, if applicable

  • Notes, if applicable

  • Order Line data as follows (may span multiple order lines)

    • Product

    • Scheduled Date

    • Quantity

    • Unit Price

In Odoo 13 CE I have already managed to import thousands of contacts and sales orders from Odoo 12 EE, as well as the needed products. I have also managed to import all of the non-order-line data for our purchase orders. It is the order-line-data import that is proving to be an intractable problem.

I have reviewed the required fields in the Purchase Order Line model, of which there are four:

  • name

  • order_id

  • price_unit

  • product_qty

Of these four, I suspect that I may not be providing the correct "order_id" data for the order lines, but I cannot find among available export fields in the Odoo 12 EE data what that data might be. It does not appear to be the "External ID" for the order line, even though Odoo 12 EE and Odoo 13 CE both generate such external IDs.

I would appreciate knowing, if possible, exactly which fields I should export from Odoo 12 EE in order to fill in the purchase-order-line data in Odoo 13 CE. Thank you.






Avatar
Discard
Best Answer

Hi:

You should select the following columns while exporting:

  • name : Order Lines/Description

  • order_id : External ID

  • price_unit : Order Lines/Unit Price

  • product_qty : Order Lines/Quantity

Please note that you need to export the main "External ID" column and not the "Order Lines/External ID" column since you need the order_id.


Avatar
Discard
Author

Paresh: just a quick update on my original reply to your kind response--still unable to find any combination of columns that will import, using the order-line model's required fields. In fact, using even the Odoo 13 CE Export Wizard for the Purchase app, I cannot find any selection that would output "order_id".

Author

A quick update, Paresh: problem solved. I found that the following minimum set of fields will work for a purchase order import file for Odoo 13 CE:

-- partner_id/id (Vendor / External ID)

-- order_line/name (Order Lines / Description)

-- order_line/date_planned (Order Lines / Scheduled Date)

-- order_line/product_qty (Order Lines / Quantity)

-- order_line/price_unit (Order Lines / Unit Price)

-- order_line/product_id/id (Order Lines / Product / External ID)

-- order_line/product_uom/id (Order Lines / Unit of Measure / External ID)

A couple of surprises here. Unlike imports for certain other modules, e.g., account vouchers ("Vendor Receipts"), we must supply the External IDs for product and vendor, rather than simply the names of product and vendor. And, we must supply the unit of measure.

I found the above by debugging an import for Odoo 12 EE. I now remember having to supply a UOM ID for v12 PO imports, but it has been so long that I'd forgotten.

Thank you for your help.

Great. Thanks for posting the final solution. Cheers.

Thanks for the minimum set of fields, It works in V13 EE as well.

Best Answer

For me, my missing required field was "order_line/date_planned". I use these fields to import my data to Odoo 13 EE Online:

  • partner_id (supplier name)

  • order_line/name

  • order_line/product_qty

  • order_line/taxes_id/id

  • order_line/price_unit

  • order_line/product_id (product name)

  • order_line/product_uom/id

  • order_line/date_planned

  • currency_id/id

I hope it helps. 

Best regards

Avatar
Discard
Author

Thank you.

Author Best Answer

Thank you, Paresh. I have tried that combination of columns but to no avail. For example, a spreadsheet with these columns:

  • id (the main External ID)

  • name (Order Reference)

  • date_order (Order Date)

  • origin (Source Document)

  • user_id/id (Purchase Representative)

  • order_line/name (Order Lines / Description)

  • order_line/product_qty (Order Lines / Quantity)

  • order_line/price_unit (Order Lines / Unit Price)

  • partner_id (Vendor / Name)

Yields this error message:

"new row for relation "purchase_order_line" violates check constraint "purchase_order_line_accountable_required_fields" DETAIL: Failing row contains (4, Bermuda 2 Strand TX GCI, 10, 250.000, null, null, null, null, 8.50, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, 2, 2019-11-11 05:51:17.827279, 2, 2019-11-11 05:51:17.827279, null, null, null, t, null, null). at row 2 (PO10461)"

I would note that the field name for the main External ID is "id" rather than "order_id". Perhaps I've missed it, but in the available fields for update data in the Odoo 12 EE export wizard, I am unable to find a field "order_id".

Following your guidance, I will try other combinations to see if any work and update this thread.




Avatar
Discard

Hello,

I am facing the same issue,

any answer yet ?

Regrades ,

Abdulmonem

Author

Please see my reply to Paresh Wagh above, dated 11 November 2019. The problem is solved and I report which fields are required. Thank you.

The issue is that i already folow the same format but when i line order_line/name (Order Lines / Description) or order_line/name (Order Lines / product) i got this error Missing required value for the field 'name' between rows 2 and 3

Author

Just to confirm, does your import file contain these fields?

-- partner_id/id (Vendor / External ID)

-- order_line/name (Order Lines / Description)

-- order_line/date_planned (Order Lines / Scheduled Date)

-- order_line/product_qty (Order Lines / Quantity)

-- order_line/price_unit (Order Lines / Unit Price)

-- order_line/product_id/id (Order Lines / Product / External ID)

-- order_line/product_uom/id (Order Lines / Unit of Measure / External ID)

Thanks a lot it worked now the issue is the product id and the vendor id

Author

Thank you for the update. Glad to hear it.

Related Posts Replies Views Activity
4
Feb 24
6661
3
Mar 24
3082
0
Sep 23
2557
0
Nov 22
2161
1
Oct 22
2217