Some data imports are simple and others I am finding impossible!
The ImportFAQ document is OK up to a point but not quite adequate for some imports.
The import-compatible export is not, as far as I can tell, comprehensive in specifying the mandatory fields for an import. Or am I missing something?
Specifically I am trying to import an Inventory Transfer from stock to a specific customer - any suggestions how to find the minimum set of fields needed in the import file?
Eg when I try - despite there being a valid product_id - I get
null value in column "product_id" violates not-null constraint DETAIL: Failing row contains (187, Canis Plus Lamb - 500g - Rolle, 10, 1, 2019-02-25 16:29:58.929875, 2019-02-23 17:49:58, 1, 2019-02-23 17:49:21, null, 5.0, 10.000, null, null, 12, 9, null, 103, null, draft, null, null, make_to_stock, f, null, null, t, null, null, null, null, null, f, null, null, 2, 2, 2019-02-25 16:29:58.929875, f, null, null, null, null, null). at row 2
Is the data that follows in the error message useful/usable in any way?
Happy to post my import file but at the moment most keen to understand the principles rather than solve one problem. I think others might find that useful too.
Cant ask on the Odoo Forum as I dont have enough karma so any assistance here would be most welcome. Thanks
The import compatible export doesn't specify required fields in any way, the only difference is the import compatible export keeps the header of the exported document (csv/excel)
such that, headers are actual technical name of the fields that's getting exported, so same the document can be imported without any need of manually selecting the columns. You don't get the functionality if your column headers are not matching with underlying fields name. The error message specifically mentioned that product_id
field is null
, even if you added product_id
column, that column is not mapped with the required field, for example in case of importing stock.picking (Inventory Transfer)
document, every line in stock.picking
record is a stock.move
record and for a stcok.move
record, product_id
is having not null
constraint. So if you somehow managed to map product_id
column with wrong related field, you get this error message.
If you had attach example of your file, it would be much easier.
I have generated a working stock.picking
for you to test, just import as it is, but you have to change the value of move_lines/product_id/.id
and partner_id/.id
fields according to your product and partner database ID
.
name,company_id/id,location_dest_id/id,picking_type_id/id,move_type,location_id/id,move_lines/product_id/.id,move_lines/product_uom_qty,move_lines/date_expected,move_lines/location_dest_id/id,move_lines/name,move_lines/date,move_lines/location_id/id,move_lines/procure_method,move_lines/product_uom/id,partner_id/.id
IMPORT0001,base.main_company,stock.stock_location_stock,stock.picking_type_in,As soon as possible,stock.stock_location_suppliers,1000,40,2019-04-05 19:41:54,stock.stock_location_stock,"Digitizer (Black, OEM, Apple iPad)",2019-04-07 08:32:24,stock.stock_location_suppliers,Default: Take From Stock,product.product_uom_unit,705