↵select↑↓navigateescclose
Search ERPNext TaskView

Configuration

The settings TaskView for ERPNext reads, the hook that picks the Timesheet for a timer, and everything the app adds to a site.

Updated
On this page

TaskView has no settings page of its own. It is configured through fields on documents you already use, a few standard ERPNext settings, and one hook for developers. This page lists them, then lists everything the app adds to your site.

For staff and project managers

SettingWhereWhat it does
Expected Time (in hours)Task formThe task's hour budget. Without one, the task uses the sum of its subtasks. See Hour budgets.
Budgeted HoursProject form, below Estimated CostThe project's hour budget. Without one, the project uses the sum of its top-level tasks.
User IDEmployee formTimers log to the Employee whose User ID is the person's login, so each person who times work needs one.
RolesUser formTo time a task or log time on it, a person needs read on its Project and write on the Task. To change a task or project in the tree, they need write on it. ERPNext's Projects User gives all of these.
CustomerProject formDecides which customer's contacts and portal users can see the project in the client portal.

The side panel in Task View opens the Task or Project, so these are one click from the tree.

For administrators

SettingWhereWhat it does
Customer accessCustomer: Portal Users; Contact linked to the Customer; Project: UsersWho may open which project on the portal. See Giving customers access.
Default Portal Home, Portal MenuPortal SettingsWhere customers land after signing in, and whether ERPNext's own Projects row (/project) is still listed. Installing the app sets the first to /projects (unless the site already has one) and unticks the second: see Install and upgrade.
Client Portal Notification TypeNotification TypeThe kind of notification the team receives when a customer acts on the portal. Whether it also goes out by email follows each user's Notification Settings.
Outgoing emailEmail AccountNotification emails need your site's outgoing email to be set up. This was not tested for these docs.
Ignore User Time Overlap, Ignore Employee Time OverlapProjects SettingsBoth must be ticked for timers to work. A paused timer's time log overlaps the timer that ran in the meantime, and ERPNext otherwise refuses the Timesheet. See Allow overlapping time logs.
File size limitSite configurationThe portal rejects files over 25 MB in the browser and leaves the real limit to your site's own file size setting.

The app reads no keys of its own from site_config.json. The one site setting it looks at is Frappe's developer_mode, and only for the portal's development server: see Development.

Some behaviour is fixed in the code and cannot be changed from the desk: the four board columns (Open, Working, Pending Review, Completed), the portal's list of accepted file types for customers, the limits of 60 new tasks, 60 comments and 60 uploads per hour from one IP address, and the one-minute refresh of an open project. The client portal describes each.

Roles and permissions the app checks

The app adds no roles. It checks ERPNext's own permissions, and the portal its own access rules:

ActionWhat is checked
Start, pause, stop, discard or log timeRead on the Project and write on the Task. A new row's Task must belong to that Project. The Timesheet must be a draft and be your Employee's, one you created, or one your role lets you write.
Rename, re-status or drag a task or project in the treeWrite on each Task or Project the change touches: for a drag, the task, its new parent and every subtask that moves with it, and read on the Project it moves to.
Add a subtaskWrite on the parent task. New documents are inserted normally, so ERPNext checks create.
Open a row panelRead on the Task or Project.
Change a field in a row panelWrite on the Task or Project. It is saved as a normal document, so ERPNext's validation applies.
Tick Completed in the timer dialogsThe Task is saved as a normal document, so write on it and ERPNext's validation apply.
Open a project or task on the portalThe access rules in Giving customers access, for Website Users. System Users get their normal ERPNext permissions.
See the Projects entry in the portal menuThe Customer role.

Choose which Timesheet receives time

By default, a timer adds its time to the draft Timesheet that matches the Employee and the project, and creates one when there is none. A developer can replace that choice with the taskview_find_timesheet hook, for example to keep one Timesheet per calendar month per project.

The hook is called with the keyword arguments employee and project and returns the name of a draft Timesheet to reuse, or None to create a new one. employee is None when the user has no Employee. If several apps register the hook, the last registered one is used.

# hooks.py of your own app
taskview_find_timesheet = "my_app.timesheets.find_timesheet"
# my_app/timesheets.py
import frappe


def find_timesheet(employee: str | None, project: str) -> str | None:
	return frappe.db.exists(
		"Timesheet",
		{"employee": employee, "parent_project": project, "docstatus": 0},
	)

Name the parameters employee and project exactly: TaskView passes them by keyword. Return only a Timesheet that is still a draft, because the timer appends a row to whatever you return and saves it.

What the app adds to your site

This is the complete list, so you can see what a bench migration changes.

Fields and property settings

DocumentChange
ProjectA Budgeted Hours field (budgeted_hours, Float, not negative) after Estimated Cost. Its description reads "Hours budgeted for the whole project. Leave 0 to use the sum of the task estimates."
ProjectDefault view set to Task View. Customer is shown in the list view, the standard filters, the filters and the preview.
TaskDefault view set to Task View. Track Changes is switched on, which records the status changes the portal's activity feed shows. Show Title Field in Link is switched on.
Timesheet DetailFour read-only fields: Paused, Start Time, Paused Time (paused_time_in_seconds, editable after submit) and Task Subject (fetched from the task). They hold the timer state.
ToDoA read-only Pinned check (pin) after Priority. Pinned tasks are ToDos with this box set.

Behaviour

WhereChange
TaskThe Task class is extended so that the portal can save a task, close its assignments and update its parent and dependent tasks on behalf of a customer, who holds no Task permission. Saves that do not ignore permissions take ERPNext's normal path.
TimesheetSubmitting a Timesheet moves a task forward only: Open becomes Working, and a task in Pending Review or Completed stays where it is. ERPNext's own code would move a Pending Review task back to Working, and before ERPNext 16.51 it did the same to a Completed one.
Timesheet DetailThe class carries the typed timer fields above. Timer calls check read on the Project, write on the Task, that a new row's Task is in its Project, and access to the draft Timesheet before they write a row.
Notification TypeA Client Portal type is created when the app is installed or the site is migrated, and installing the app adds it to existing users' email preferences.
Website/projects and everything under it is served by the portal. The portal menu gets a Projects entry for users with the Customer role. /project redirects to /projects.
DeskThe Task View and timer dock bundles load on every desk page.
Install, migrateafter_install runs the portal set-up described in Install and upgrade. after_migrate creates the Client Portal Notification Type if it is missing.

The app adds no DocTypes, roles, reports, workspaces or scheduled jobs, and uses no doc_events, override_doctype_class or doctype_js.

Endpoints

These whitelisted methods are what the desk and the portal call. Each checks permissions as described above.

MethodUsed by
erpnext_taskview.erpnext_taskview.api.getTask View: the projects and tasks of the tree
erpnext_taskview.erpnext_taskview.api.save_docTask View: saving a project or task, and every timer operation
erpnext_taskview.erpnext_taskview.api.bulk_create_tasks, delete_task, assign_task, unassign_taskTask View: adding subtasks in bulk, deleting, assigning
erpnext_taskview.erpnext_taskview.api.pin_task, unpin_task, create_pinned_task, reorder_pinned_tasks, set_task_projectThe Pinned view
erpnext_taskview.erpnext_taskview.api.get_active_timersThe timer dock
erpnext_taskview.erpnext_taskview.api.get_task_descriptionsCopying tasks as Markdown
erpnext_taskview.erpnext_taskview.api.get_row_detail, update_rowTask View: reading and saving the details in a row panel
erpnext_taskview.erpnext_taskview.budget.get_budget_summaryRefreshing the budget meters
erpnext_taskview.portal.api.get_projects, get_project, get_taskThe portal's pages
erpnext_taskview.portal.api.set_task_status, create_task, add_comment, upload_attachmentThe portal's writes (POST only)
erpnext_taskview.portal.api.download_fileFiles and images on the portal (GET only)
erpnext_taskview.www.projects.get_context_for_devThe portal's development server, on a site in developer mode only