Skip to content

[18.0][IMP] hr_timesheet_sheet: add configurable approver field - #945

Open
smorita7749 wants to merge 2 commits into
OCA:18.0from
qrtl:18.0-imp-hr_timesheet_sheet
Open

[18.0][IMP] hr_timesheet_sheet: add configurable approver field#945
smorita7749 wants to merge 2 commits into
OCA:18.0from
qrtl:18.0-imp-hr_timesheet_sheet

Conversation

@smorita7749

Copy link
Copy Markdown
Contributor

The improvement adds a configurable approver field to add approvers in addition to the groups.

@qrtl QT6883

Add a company setting that points to a res.users field on hr.employee.
The user set in that field for an employee can review the employee's
timesheet sheets, in addition to the users granted by the review policy.
The field is referenced dynamically by name, so fields added by other
modules can be used without depending on them.

task-6883
Comment thread hr_timesheet_sheet/models/hr_timesheet_sheet.py Outdated

@AungKoKoLin1997 AungKoKoLin1997 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update the readme as necessary.

Comment thread hr_timesheet_sheet/models/hr_timesheet_sheet.py Outdated
Read the configured employee field directly in _get_possible_reviewers()
instead of exposing it through a computed approver_id field on the sheet.

The field was not needed for the feature. Since the employee field name
is chosen at runtime, it cannot be declared in @api.depends, so the
field could not be stored without going stale, and showing a single
approver on the form was misleading: the users allowed by the review
policy may review the sheet as well.

Document the new setting in readme/CONFIGURE.md.

@AungKoKoLin1997 AungKoKoLin1997 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review: LG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_timesheet_sheet Module hr_timesheet_sheet series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants