Allow editing of Harvest cache data
i needed it to fix some data sync..
This commit is contained in:
		
							parent
							
								
									14e021db0d
								
							
						
					
					
						commit
						b8fd9c3022
					
				
					 3 changed files with 16 additions and 9 deletions
				
			
		|  | @ -34,12 +34,16 @@ class HarvestMasterView(MasterView): | ||||||
|     Base class for Harvest master views |     Base class for Harvest master views | ||||||
|     """ |     """ | ||||||
|     creatable = False |     creatable = False | ||||||
|     editable = False |  | ||||||
|     has_versions = True |     has_versions = True | ||||||
|     model_row_class = HarvestTimeEntry |     model_row_class = HarvestTimeEntry | ||||||
| 
 | 
 | ||||||
|     labels = { |     labels = { | ||||||
|         'id': "ID", |         'id': "ID", | ||||||
|  |         'user_id': "User ID", | ||||||
|  |         'client_id': "Client ID", | ||||||
|  |         'project_id': "Project ID", | ||||||
|  |         'task_id': "Task ID", | ||||||
|  |         'invoice_id': "Invoice ID", | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     row_labels = { |     row_labels = { | ||||||
|  |  | ||||||
|  | @ -87,6 +87,17 @@ class HarvestProjectView(HarvestMasterView): | ||||||
|         if not project.is_active: |         if not project.is_active: | ||||||
|             return 'warning' |             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): |     def get_row_data(self, project): | ||||||
|         model = self.model |         model = self.model | ||||||
|         return self.Session.query(model.HarvestTimeEntry)\ |         return self.Session.query(model.HarvestTimeEntry)\ | ||||||
|  |  | ||||||
|  | @ -37,14 +37,6 @@ class HarvestTimeEntryView(HarvestMasterView): | ||||||
|     url_prefix = '/harvest/time-entries' |     url_prefix = '/harvest/time-entries' | ||||||
|     route_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 = [ |     grid_columns = [ | ||||||
|         'id', |         'id', | ||||||
|         'spent_date', |         'spent_date', | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar