-
- Downloads
[FIX] analytic, hr_timesheet: recompute order
When creating a timesheet, several fields need to be recomputed: - `currency_id` - `group_id` - `department_id` - `is_timesheet` - `validated` When `validated` is computed before the other fields, the recomputation will lead to an `AccessError` because of the rule `hr_timesheet.timesheet_line_rule_user`. Since the test `test_timesheet_validation_user` expects an `AccessError`, the test succeeds. However, from time to time, `validated` is computed last => the `AccessError` is not raised. Actually, a `ValidationError` should be raised in this case (from the `create` override in `timesheet_grid`). This commit is a cherry-pick of 802339c1 and dcca2e8b
Showing
- addons/account/models/account_analytic_line.py 2 additions, 1 deletionaddons/account/models/account_analytic_line.py
- addons/analytic/models/analytic_account.py 2 additions, 2 deletionsaddons/analytic/models/analytic_account.py
- addons/hr_timesheet/models/hr_timesheet.py 1 addition, 1 deletionaddons/hr_timesheet/models/hr_timesheet.py
Please register or sign in to comment