From b8fd9c302289ef7caa2a8f13b8a2d31bdf56eee4 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 30 Jan 2022 12:38:15 -0600 Subject: [PATCH] Allow editing of Harvest cache data i needed it to fix some data sync.. --- tailbone_harvest/views/harvest/master.py | 6 +++++- tailbone_harvest/views/harvest/projects.py | 11 +++++++++++ tailbone_harvest/views/harvest/time_entries.py | 8 -------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tailbone_harvest/views/harvest/master.py b/tailbone_harvest/views/harvest/master.py index 96b0537..35c2286 100644 --- a/tailbone_harvest/views/harvest/master.py +++ b/tailbone_harvest/views/harvest/master.py @@ -34,12 +34,16 @@ class HarvestMasterView(MasterView): Base class for Harvest master views """ creatable = False - editable = False has_versions = True model_row_class = HarvestTimeEntry labels = { 'id': "ID", + 'user_id': "User ID", + 'client_id': "Client ID", + 'project_id': "Project ID", + 'task_id': "Task ID", + 'invoice_id': "Invoice ID", } row_labels = { diff --git a/tailbone_harvest/views/harvest/projects.py b/tailbone_harvest/views/harvest/projects.py index cca48a6..9966801 100644 --- a/tailbone_harvest/views/harvest/projects.py +++ b/tailbone_harvest/views/harvest/projects.py @@ -87,6 +87,17 @@ class HarvestProjectView(HarvestMasterView): if not project.is_active: return 'warning' + def configure_form(self, f): + super(HarvestProjectView, self).configure_form(f) + + if self.editing: + f.remove('client') + f.set_type('over_budget_notification_date', 'date_jquery') + f.set_type('starts_on', 'date_jquery') + f.set_type('ends_on', 'date_jquery') + f.set_readonly('created_at') + f.set_readonly('updated_at') + def get_row_data(self, project): model = self.model return self.Session.query(model.HarvestTimeEntry)\ diff --git a/tailbone_harvest/views/harvest/time_entries.py b/tailbone_harvest/views/harvest/time_entries.py index 3ddfdab..8001fab 100644 --- a/tailbone_harvest/views/harvest/time_entries.py +++ b/tailbone_harvest/views/harvest/time_entries.py @@ -37,14 +37,6 @@ class HarvestTimeEntryView(HarvestMasterView): url_prefix = '/harvest/time-entries' route_prefix = 'harvest.time_entries' - labels = { - 'user_id': "User ID", - 'client_id': "Client ID", - 'project_id': "Project ID", - 'task_id': "Task ID", - 'invoice_id': "Invoice ID", - } - grid_columns = [ 'id', 'spent_date',