Low ORM write performance - checking worklfow
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
The problem is in updating many resource in one, fast update.
The problem is in write() method. It make one, nice, fast update on all resources, but then check every resource about its workflow, one by one, what takes really long time.
In the end of the write() method, is called step_workflow(), which works on every resource individually.
Example situation:
class wyn_wyn(osv.osv):
""" Wyn """
_name = 'wyn.wyn'
_columns = {
}
Wizard, that calculates savings (let's say now set on 123):
def calculate(self, cr, uid, ids, context=None):
wyn = self.pool.
ids = wyn.search(cr, uid, '')
return {'type': 'ir.actions.
Write() method does one nice update, and then ask every resource about workflow. Resulting in queries for each resource:
select * from wkf_workitem where inst_id=8056
select * from wkf_activity where id=5
select * from wkf_transition where act_from=5
select wkf_id from wkf_instance where id=8056
select state,flow_stop from wkf_workitem w left join wkf_activity a on (a.id=w.act_id) where w.inst_id=8056
Possible solutions:
- parameter to write() method to disable checking workflow
- group searching for workflows which need to make transition
Question about this issue was previously asked at:
http://
description: | updated |