[7.0] load() and import_data() no longer provide ".id" upsert feature

Bug #1186977 reported by Daniel Reis on 2013-06-03
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

In OpenERP 6.1 the import_data() method allowed for upsert feature when using Database IDs, by providing an ID 0 to the new (to insert) records.
In OpenERP 7.0/trunk this is no longer possible: providing and ID 0 raises the error "Unknown database identifier '0'"

In particular, this stops the Pentaho Kettle OpenERP Step from working correctly.
The server fix for this is very simple, and it would be important for OpenERP to interact well with ETL tools such as Kettle.

----
Issue demonstration, using erppeek:

main-demo6 >>> do("res.partner","import_data", ['.id','name'],[[1,'Update Partner'], [0,'New Partner']])
[2, 0, 0, 0]

main-demo7 >>> do("res.partner","import_data", ['.id','name'],[[1,'Update Partner'], [0,'New Partner']])
[-1, {}, "Line 2 : Unknown database identifier '0'", '']

main-demo7 >>> do("res.partner","load", ['.id','name'],[[1,'Update Partner'], [0,'New Partner']])
{'ids': False,
 'messages': [{'field': '.id',
               'message': "Unknown database identifier '0'",
               'record': 1,
               'rows': {'from': 1, 'to': 1},
               'type': 'error'}]}

main-demo7 >>> do("res.partner","load", ['.id','name'],[[1,'Update Partner']])
{'ids': [1], 'messages': []}

main-demo7 >>> do("res.partner","load", ['.id','name'],[[0,'New Partner']])
{'ids': False,
 'messages': [{'field': '.id',
               'message': "Unknown database identifier '0'",
               'record': 0,
               'rows': {'from': 0, 'to': 0},
               'type': 'error'}]}

Daniel Reis (dreis-pt) wrote :

@odony: just reminding you on this issue, as discussed in the OpenERP Days.

+1 Daniel

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers