Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] hr_timesheet_sheet: Improve search speed for can_review field #630

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

lpolitanski-tempoconsulting

This is a followup to #581 taking into account the feedback by @len-foss
Remedies slowdowns in search speed when there are lots of timesheets by avoiding expensive call to

self.search([]).filtered(
            lambda sheet: check(sheet._get_possible_reviewers())
        )

and not passing a domain that checks for exclusion/inclusion against lots of timesheet ids.

@lpolitanski-tempoconsulting lpolitanski-tempoconsulting marked this pull request as draft January 24, 2024 08:36
@lpolitanski-tempoconsulting lpolitanski-tempoconsulting force-pushed the 14.0-imp-hr_timesheet_sheet branch 5 times, most recently from 2c43d94 to 557fa05 Compare January 24, 2024 13:02
@lpolitanski-tempoconsulting lpolitanski-tempoconsulting marked this pull request as ready for review January 24, 2024 13:08
@lpolitanski-tempoconsulting lpolitanski-tempoconsulting changed the title [14.0][IMP] hr_timesheet_sheet: Improve compute and search speed for can_review field [14.0][IMP] hr_timesheet_sheet: Improve search speed for can_review field Jan 24, 2024
Copy link

@len-foss len-foss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I think an improvement would be to use osv.expression to use AND and OR rather than + ["&"] to extend the domains, to be more robust in case of module overrides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants