Skip to content

[FIX] analytic_base_department: expose account_department_id in timesheets report - #951

Open
AuresTICConsultores wants to merge 1 commit into
OCA:18.0from
aurestic:fix/hr-timesheet-report-department-oca
Open

[FIX] analytic_base_department: expose account_department_id in timesheets report#951
AuresTICConsultores wants to merge 1 commit into
OCA:18.0from
aurestic:fix/hr-timesheet-report-department-oca

Conversation

@AuresTICConsultores

Copy link
Copy Markdown

analytic_base_department inserts account_department_id in the shared
view analytic.view_account_analytic_line_filter. hr_timesheet has its
own report view (hr_timesheet_report_search), a "primary" view on the
SQL model timesheets.analysis.report that inherits its combined arch
from that same shared view -- but that reporting model only exposes a
subset of account.analytic.line's fields (it did not include
account_department_id), so the view fails validating as soon as both
modules are installed together (reproduced both on a clean install and
on an -u against a real, already populated database).

Fix: expose account_department_id also on timesheets.analysis.report
(models/hr_timesheet_report.py), extending _select() the same way core
hr_timesheet already does for department_id. Requires depending on
hr_timesheet explicitly -- without it, analytic_base_department could
load before hr_timesheet in the module graph, and this file's
extension would never make it in time to prevent the failure.

Adds a test that reads account_department_id back from
timesheets.analysis.report, which fails before this fix (field does
not exist on the model) and passes after.

@OCA-git-bot OCA-git-bot added series:18.0 mod:analytic_base_department Module analytic_base_department labels Jul 30, 2026
@AuresTICConsultores
AuresTICConsultores force-pushed the fix/hr-timesheet-report-department-oca branch from b989f22 to 8c6554e Compare July 30, 2026 18:57
…heets report

analytic_base_department inserts account_department_id in the shared
view analytic.view_account_analytic_line_filter. hr_timesheet has its
own report view (hr_timesheet_report_search), a "primary" view on the
SQL model timesheets.analysis.report that inherits its combined arch
from that same shared view -- but that reporting model only exposes a
subset of account.analytic.line's fields (it did not include
account_department_id), so the view fails validating as soon as both
modules are installed together (reproduced both on a clean install and
on an -u against a real, already populated database).

Fix: expose account_department_id also on timesheets.analysis.report
(models/hr_timesheet_report.py), extending _select() the same way core
hr_timesheet already does for department_id. Requires depending on
hr_timesheet explicitly -- without it, analytic_base_department could
load before hr_timesheet in the module graph, and this file's
extension would never make it in time to prevent the failure.

Adds a test that reads account_department_id back from
timesheets.analysis.report, which fails before this fix (field does
not exist on the model) and passes after.
@AuresTICConsultores
AuresTICConsultores force-pushed the fix/hr-timesheet-report-department-oca branch from 8c6554e to 7ac0370 Compare July 30, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:analytic_base_department Module analytic_base_department series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants