diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-11-05 16:00:47 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-11-05 16:23:48 +0100 |
| commit | a23468c845425f3187c9c76dd2200fb9a1c9f3ab (patch) | |
| tree | b430aea0a0059a64d255ca46f80033f9f85e3b69 /addons/analytic_user_function/analytic_user_function.py | |
| parent | 80c7209d2e7d80f85e1598e06352ff8d73939d6a (diff) | |
[FIX] hr_timesheet_sheet: total attendances & timesheets performances
For these function fields, bypassing the ORM, using a SQL query,
improves the execution time by 100 for a set of 80 timesheets
in a database with
- 250K `hr.analytic.timesheet`
&
- 250K `hr.attendance`.
These function fields depends on a one2many field which use
the SQL view `hr_timesheet_sheet_sheet_day`.
When performing `sheet.period_ids`, two SQL requests are performed,
- the first just to know the ids in the sql view matching this sheet
- the second to read the fields `total_attendance` & `total_timesheet`
and the request is performed on the entire set of lines of this view
(~250K lines in the observed use case)
while, when replaced by this SQL request, only one request is performed,
on a restricted set of lines, speeding up significantly the computation
of these computed fields for smaller sets of sheets.
opw-653447
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function.py')
0 files changed, 0 insertions, 0 deletions
