orm.py import_data fails when importing account.fiscal.positions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Yogesh (SerpentCS) |
Bug Description
Trying to import following :
ID|name|
fiscal_
fiscal_
fiscal_
(I already hacked client to accept old style names see other bug I reported on client : https:/
Importing this in 5.0.5 (bzr stable) produced following stack trace
[2009-09-16 17:28:32,714] ERROR:web-
[2009-09-16 17:28:32,714] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,715] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,716] ERROR:web-
[2009-09-16 17:28:32,717] ERROR:web-
[2009-09-16 17:28:32,717] ERROR:web-
[2009-09-16 17:28:32,717] ERROR:web-
[2009-09-16 17:28:32,717] ERROR:web-
[2009-09-16 17:28:32,717] ERROR:web-
[2009-09-16 17:28:32,717] ERROR:web-
[2009-09-16 17:28:32,717] ERROR:web-
The fix for this is quite easy :
=== modified file 'bin/osv/orm.py'
--- bin/osv/orm.py 2009-09-15 08:17:44 +0000
+++ bin/osv/orm.py 2009-09-16 15:45:18 +0000
@@ -607,6 +607,8 @@
if (len(field)
+ if field[len(
+ continue # This field does not belong to this prefix !
@@ -631,7 +633,7 @@
- row[field[0][:-3]] = res_id or False
+ row[field[
if (len(field) == len(prefix)+1) and \
Part 1 of the fix skips the current field if that field does not belong to the current prefix we're handling
Part 2 fixes a problem with column names not being mapped correctly.
I submit this bug/patch with a warning, it now works for me, do your own import tests please.
Related branches
Changed in openobject-server: | |
assignee: | nobody → Ysa(Open ERP) (ysa-openerp) |
Changed in openobject-server: | |
status: | New → Confirmed |
Changed in openobject-server: | |
status: | Confirmed → In Progress |
patch file