Skip to content

[18.0][ADD] hr_timesheet_encode_day_float: add new module - #944

Open
marcelsavegnago wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-add-hr_timesheet_encode_day_float
Open

[18.0][ADD] hr_timesheet_encode_day_float: add new module#944
marcelsavegnago wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-add-hr_timesheet_encode_day_float

Conversation

@marcelsavegnago

Copy link
Copy Markdown
Member

This pull request introduces the new hr_timesheet_encode_day_float module, which allows users to enter timesheet values in days as free decimal floats, rather than being limited to a half-day toggle. The implementation includes configuration, data changes, uninstall handling, and tests to ensure correct behavior.

Main features and changes:

Feature: Free Decimal Day Input for Timesheets

  • Adds the hr_timesheet_encode_day_float module, enabling timesheet day encoding as a free decimal float field instead of a fixed toggle (0 / 0.5 / 1). Users can now enter any fraction of a day (e.g., 0.2, 0.75, 3). (__manifest__.py, README.rst, DESCRIPTION.md, USAGE.md) [1] [2] [3] [4]
  • Updates the unit of measure (uom.product_uom_day) to use the float_factor widget, allowing free decimal input. (data/uom_data.xml)

Configuration and Integration

  • Extends res.config.settings to add "Days" as a selectable timesheet encoding method, integrating the new float input into standard settings. (models/res_config_settings.py)

Uninstall Handling

  • Implements an uninstall hook to restore the default half-day toggle widget when the module is uninstalled, ensuring clean removal. (hooks.py)

Testing

  • Adds comprehensive tests to verify the new widget, settings integration, uninstall behavior, and correct conversion between days and hours. (tests/test_encode_day_float.py)

Documentation and Packaging

  • Provides a generated README.rst, usage instructions, contributor credits, and packaging files for OCA compatibility. (README.rst, CONTRIBUTORS.md, pyproject.toml) [1] [2] [3]

These changes make timesheet entry in days more flexible and user-friendly, while maintaining compatibility with Odoo's unit of measure and timesheet configuration.

@marcelsavegnago
marcelsavegnago marked this pull request as draft July 21, 2026 16:19
@OCA-git-bot OCA-git-bot added series:18.0 mod:hr_timesheet_encode_day_float Module hr_timesheet_encode_day_float labels Jul 21, 2026
@marcelsavegnago
marcelsavegnago marked this pull request as ready for review July 21, 2026 16:31
@marcelsavegnago
marcelsavegnago force-pushed the 18.0-add-hr_timesheet_encode_day_float branch from 89de567 to d432c52 Compare July 21, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_timesheet_encode_day_float Module hr_timesheet_encode_day_float series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants