Timesheet assistant

The timesheet assistant monitors computer and browser activities using ActivityWatch to generate timesheet entry suggestions and therefore simplify timesheet logging.

To use the timesheet assistant, activate the feature and install the ActivityWatch app on your computer. Install the browser extension as well if browser activity tracking is required.

Timesheet suggestions are generated based on assistant rules and calendar events and planning in Odoo, then matched to projects and tasks, taking into account previously matched suggestions. They can be reviewed and converted into timesheet entries directly from the timesheet assistant view.

Note

All activity data is processed locally on the user’s device and is never shared with anyone, either within or outside their organization.

Configuration

Activation

Note

The timesheet assistant is only available when the Encoding method is set to Hours / Minutes in the Timesheets settings.

To enable the timesheet assistant, go to Timesheets ‣ Configuration ‣ Settings and enable Timesheets Assistant.

Installation

The timesheet assistant tracks user activity through the ActivityWatch app (for computer activity) and browser extension (for browser activity). To install the timesheet assistant, follow these steps:

  1. Go to Timesheet ‣ Assistant.

  2. If the browser displays a popup requesting permission to access apps and devices on your device, click Allow.

  3. Follow the installation steps for Desktop activity (mandatory) and Browser activity (optional).

Tip

If the popup does not appear in Google Chrome, follow these steps:

  1. Click the tune icon (View site information) to the left of the address bar.

  2. Click Site settings.

  3. At the bottom of the Permissions list, set the Apps on device field to Allow.

  4. Refresh the Odoo Timesheets page.

To grant this permission in Mozilla Firefox, refer to the Mozilla documentation.

Desktop activity

To track time spent in applications on your computer, install the ActivityWatch application by going to Timesheets ‣ Assistant, clicking Start Now, and following the instructions for your operating system below.

Note

The minimum supported versions are Windows 10, macOS 10.15, and Ubuntu 22.

  1. In the Install Timesheets Assistant window, click Download for Windows in the Desktop Activity section, then select your OS version.

  2. Install the package and follow the instructions.

  3. Once the installation is finished, restart your computer or log out and log back in.

  4. Access the Odoo database, go to Timesheets ‣ Assistant, and click Start Now.

  5. Click Next twice.

  6. In the Configure CORS window, copy the Odoo database URL by clicking the (copy) icon.

  7. Click Open Settings.

  8. On the ActivityWatch web page, scroll down to the Server Settings section and paste the Odoo database URL in the CORS field.

  9. Return to the timesheet assistant popup and click Next twice.

  10. Click Test connection to verify the connection between the Odoo database and the ActivityWatch server.

Note

ActivityWatch also provides a wide range of watchers dedicated to specific activities that can be installed manually. Using more activity watchers allows the timesheet assistant to provide more accurate results.

Browser activity

Optionally, install the ActivityWatch browser extension to track time spent in browser tabs and websites.

To install the extension from Odoo, follow these steps:

  1. Go to Timesheets ‣ Assistant.

  2. Click the (Settings) icon in the right part of the screen and select Install Assistant.

  3. In the Install Timesheets Assistant window, click the Firefox or Chrome extension button in the Browser activity section, depending on your browser.

  4. Click Add to Chrome, then Add extension for Chrome, or Add to Firefox, then Add for Firefox.

Note

ActivityWatch browser extensions are only available for Google Chrome and Mozilla Firefox. The Firefox and Chrome extensions can also be installed from their respective store pages.

Assistant rules

Assistant rules use regular expressions (regex) to define how Odoo interprets desktop and browser activity and converts it into timesheet entry suggestions.

These rules act as key events: once a key event is triggered, any subsequent activity of at least one minute is associated with that event until a new key event is triggered by a matching rule. Preconfigured rules are available to track time spent in Odoo, GitHub, Google Docs, Gmail, Google Meet, and Discord.

Tip

  • Regex can be powerful but complex. RegexOne provides interactive exercises to help learn it.

  • Adding more rules improves the precision of timesheet suggestions and reduces the impact of short or irrelevant entries.

To create or edit an assistant rule, go to Timesheets ‣ Configuration ‣ Assistant Rules, then click New or select an existing rule, and fill in or edit the fields described below.

  • Name: The name of the rule.

  • Regex: The pattern matched against ActivityWatch events (window name, tab name, or URL) to identify and classify activities as key events and display them in the timesheet assistant.

  • Type: Determines the icon displayed for matching entries in the Suggestions list of the timesheet assistant.

  • Template: Defines the name of the generated timesheet entry. It is also used by local rules for further processing. If left blank, the rule’s Name is used instead.

  • Description: A display-only label shown in the timesheet assistant.

  • Always active: When enabled, activities matched by this rule are tracked even if ActivityWatch marks the user as inactive after three minutes of keyboard and mouse inactivity. This is especially useful for rules covering activities such as meetings.

Tip

To set a default project and task for timesheet entries created from matching activities, click the (additional options) button in the list header, enable Project and Task, then select the desired values from the fields in the list view.

Example

The following example configures a rule for Google Meet. When ActivityWatch recognizes a Google Meet video conference matching this regex, the timesheet assistant marks it as a key event.

  • Name: Customer Meeting

  • Regex: meet - (.*)|https://meet.google.com

  • Type: Video Conference

  • Template: Customer Meeting ($1) (refers to the value captured by the first group in the regex)

  • Description: Customer Meeting

  • Project and Task: Left empty, since each meeting may be related to a different customer/task

  • Always active: Enabled

Tip

To view the list of key events detected by ActivityWatch and the project and task assigned to them based on the configured assistant rules and/or the project and task assigned to past suggested timesheet entries, activate developer mode, then go to Timesheets ‣ Configuration ‣ Local Assistant Rules.

Use

Once the timesheet assistant has been configured, computer and browser (if applicable) activities are automatically tracked at startup each day, and calendar events and planning in Odoo are checked. Timesheet entry suggestions are then generated from key events detected by ActivityWatch based on tracked activities when their duration exceeds one minute.

To view the suggestions, go to Timesheets ‣ Assistant. By default, Suggestions are listed By Project; click Chronological in the top-right of the panel to switch to chronological order.

To create a timesheet entry from one or more suggestions, click the relevant suggestions in the list, edit the fields in the left pane if necessary, and click Create.

To delete a suggestion, hover over it and click Remove. To delete multiple suggestions at once, select them in the list and click Delete at the top of the view.

To edit or delete an existing timesheet entry, click it in the left pane, make the necessary changes, then click Save or click Delete.

Note

  • The Time Rounding settings apply to timesheet suggestions.

  • Three minutes or more without mouse or keyboard activity are interpreted as inactivity (i.e., a break), unless the Always Active option is enabled for a matching rule.

  • Timesheet suggestions are automatically assigned to projects and tasks based on the configured assistant rules and the project and task assigned to past suggestions in the timesheet assistant.

  • Timesheet suggestions remain private until timesheet entries are created from them.

Tip

To view the data recorded by ActivityWatch, activate developer mode, go to Timesheets ‣ Assistant, and click View ActivityWatch Data at the bottom of the suggestions list.