audittrail should not hold a transaction in execute method
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Critical
|
Christophe Simonis (OpenERP) |
Bug Description
audittrail module overrides OpenERP's execute() function. It creates a new cursor, executes default execute() function and registers necessary events. The problem is that as the cursor created holds the transaction until the very end this may become incompatible with code of certain modules.
For example, full_text_search module must create a table which references "ir_model" table. As the transaction started by the cr record in audittrail module has done a SELECT on "ir_model" table, full_text_search CREATE TABLE statement cannot end until audittrail's cursor has finised and thus producing a deadlock.
The following diff solves the problem by setting cr cursor into autocommit mode. This way audittrail module does not interfere in transactions created by the functions it calls and thus making it really transparent as it should.
@@ -315,6 +300,7 @@
def execute(self, db, uid, passwd, model, method, *args):
pool = pooler.get_pool(db)
cr = pooler.
+ cr.autocommit(True)
try:
proxy = pool.get(model)
if proxy is None:
Changed in openobject-addons: | |
importance: | Undecided → Critical |
status: | New → Confirmed |
assignee: | nobody → Christophe (OpenERP) (kangol) |
milestone: | none → 5.0.15 |
Here it's a diff with a file so indentation is honoured.