Skip to content

Commit

Permalink
Merge pull request #116 from gisce/report-readonly-cursor
Browse files Browse the repository at this point in the history
Add readonly cursor to report task
  • Loading branch information
ecarreras authored Apr 29, 2024
2 parents b9d5244 + 4c2f2d3 commit c5840cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oorq/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def report(conf_attrs, dbname, uid, obj, ids, datas=None, context=None):
logging.basicConfig(level=log_level)
sql_db.close_db(dbname)
conn = sql_db.db_connect(dbname)
cursor = conn.cursor()
cursor = conn.cursor(readonly=True, isolation_level='repeatable_read')
obj = netsvc.LocalService('report.'+obj)
if 'model' not in datas:
datas['model'] = getattr(obj._service, 'table', False) or getattr(obj._service, 'model', False)
Expand Down

0 comments on commit c5840cc

Please sign in to comment.