Allow editing of Harvest cache data
i needed it to fix some data sync..
This commit is contained in:
parent
14e021db0d
commit
b8fd9c3022
|
@ -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 = {
|
||||
|
|
|
@ -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)\
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue