Skip to content

[18.0][ADD] repair_analytic_timesheet: add new module#175

Draft
kaynnan wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-add-repair_analytic_distribution_timesheet_oca
Draft

[18.0][ADD] repair_analytic_timesheet: add new module#175
kaynnan wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-add-repair_analytic_distribution_timesheet_oca

Conversation

@kaynnan

@kaynnan kaynnan commented Jun 26, 2026

Copy link
Copy Markdown

cc @marcelsavegnago @WesleyOliveira98 @CristianoMafraJunior @douglascstd

This module extends Repair Analytic (repair_analytic) to include timesheet (labor) costs in the analytic distribution when a repair order is completed.

  • Adds a Spread Timesheet Cost on Repair boolean field to project.project (Settings tab), allowing each project to opt-in to this behavior.
  • On repair completion, for each timesheet linked to the repair order whose project has spread_timesheet_cost_on_repair = True, creates account.analytic.line entries distributed proportionally across all analytic accounts configured in the repair order's Analytic Distribution.
  • The amount per analytic account is calculated as timesheet.amount × percentage / 100, preserving the sign (negative = labor cost).
  • On cancel or deletion of the repair order, removes all generated analytic distribution lines while preserving the original timesheet entries.
  • Overrides _compute_analytic_line_count to count only distribution lines (those without project_id), keeping timesheet entries out of the smart button counter.

Depends on: repair_analytic (#174), repair_timesheet

@OCA-git-bot OCA-git-bot added series:18.0 mod:repair_analytic_distribution_timesheet_oca Module repair_analytic_distribution_timesheet_oca labels Jun 26, 2026
@kaynnan kaynnan force-pushed the 18.0-add-repair_analytic_distribution_timesheet_oca branch from f509580 to 4743508 Compare June 29, 2026 12:35
@OCA-git-bot OCA-git-bot added mod:repair_analytic_timesheet Module repair_analytic_timesheet and removed mod:repair_analytic_distribution_timesheet_oca Module repair_analytic_distribution_timesheet_oca labels Jun 29, 2026
@kaynnan kaynnan changed the title [18.0][ADD] repair_analytic_distribution_timesheet_oca: add new module [18.0][ADD] repair_analytic_timesheet: add new module Jun 29, 2026
@kaynnan kaynnan force-pushed the 18.0-add-repair_analytic_distribution_timesheet_oca branch from 4743508 to 851eeee Compare June 29, 2026 12:40
@kaynnan kaynnan force-pushed the 18.0-add-repair_analytic_distribution_timesheet_oca branch 3 times, most recently from 24fceb9 to 50c832e Compare July 3, 2026 13:56
@kaynnan kaynnan force-pushed the 18.0-add-repair_analytic_distribution_timesheet_oca branch from 50c832e to 823cdff Compare July 3, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:repair_analytic_timesheet Module repair_analytic_timesheet series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants