Sale Timesheet Rounded
sale_timesheet_rounded · OCA/timesheet
-
Security25/25No findings
-
Activity20/25Last human commit 10 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 7 Odoo series since 12.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
ProjectProject— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Round timesheet lines amounts in sales based on project' settings.
A typical use case is: you work 5 minutes but you want to invoice 15 minutes.
With this module you can configure a rounding unit or factor on the project and all the lines tracked on this project's tasks will show a rounded amount.
If you want you can override the value manually on each entry.
The delivered quantity on the sale order line - and by consequence on the invoice - will be computed using the rounded amount. Therefore, expense lines and other non-timesheet lines will be updated with a rounded amount that is equal to the amount.
WARNING: This module cannot be used with timesheet_grid without further adapation as an update of an existing timesheet line will NOT update the rounded amount. To achieve this, you need to override adjust_grid function to pass the force_compute context key.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 5
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
account_analytic_line_kanban_inherit |
account.analytic.line.kanban.inherit | account.analytic.line | kanban | Inherits hr_timesheet.view_kanban_account_analytic_line |
account_analytic_line_tree_inherit |
account.analytic.line.list.inherit | account.analytic.line | list | Inherits hr_timesheet.hr_timesheet_line_tree |
hr_timesheet_view_task_form2_inherited_inherit |
hr.timesheet.view.task.form2.inherited.inherit | project.task | Inherits hr_timesheet.view_task_form2_inherited | |
project_project_form_inherit |
project.project.form.inherit | project.project | form | Inherits project.edit_project |
view_account_analytic_line_form_inherit |
account.analytic.line.form.inherit | account.analytic.line | form | Inherits hr_timesheet.hr_timesheet_line_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 5
-
unit_amount_roundedFloatcompute='_compute_unit_rounded'copy=Falsereadonly=Falsestore=Truestring='Quantity rounded'
-
read(self, fields=None, load='_classic_read')Replace the value of unit_amount by unit_amount_rounded. When context key `timesheet_rounding` is True we change the value of unit_amount with the rounded one. This affects `account_analytic_line._sale_determine_order_line`.
No new fields.
Public methods (3)-
button_cancel(self) -
button_draft(self) -
unlink(self)
-
timesheet_rounding_factorFloatdefault=100.0string='Timesheet rounding factor in percentage' -
timesheet_rounding_methodSelectiondefault='NO'help='If you activate the rounding of timesheet lines, only new entries will be rounded (i.e. existing lines will not be rounded automatically).'required=Trueselection=[('NO', 'No rounding'), ('UP', 'Up'), ('HALF-UP', 'Closest'), ('DOWN', 'Down')]string='Rounding method' -
timesheet_rounding_unitFloatdefault=0.0help='1.0 = hour\n 0.25 = 15 min\n 0.084 ~= 5 min\n 0.017 ~= 1 min\n 'string='Rounding Unit'
No public methods.
No new fields.
Public methods (1)-
create_invoices(self)Override method from sale/wizard/sale_make_invoice_advance.py When the user want to invoice the timesheets to the SO up to a specific period then we need to recompute the qty_to_invoice for each product_id in sale.order.line, before creating the invoice.
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…