Possible to hack orm.py to reduce import time?
Hi,
I am trying to shorten the time taken for csv import.
Looking at the source codes, I was thinking it might be possible to achieve this by
1. Removing savepoint model_load_save
2. Put for loop withn try/exception -> exit on 1st error vs keeping track of all the errors
The modified version of load function in orm.py is listed below.
Would appreciate any comments.
regards
Li Wee
def load(self, cr, uid, fields, data, context=None):
messages = []
fields = map(fix_
ModelData = self.pool[
fg = self.fields_get(cr, uid, context=context)
mode = 'init'
noupdate = False
ids = []
try:
for id, xid, record, info in self._convert_
ids.append(
except psycopg2.Warning, e:
logger.
except psycopg2.Error, e:
# Failed to write, log to messages, rollback savepoint (to
# avoid broken transaction) and keep going
if len(messages) > 0:
ids = False
else:
cr.
return {'ids': ids, 'messages': messages}
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Li Wee, Ong for more information if necessary.