diff --git a/rattail_harvest/harvest/importing/model.py b/rattail_harvest/harvest/importing/model.py index 582c159..8b55b15 100644 --- a/rattail_harvest/harvest/importing/model.py +++ b/rattail_harvest/harvest/importing/model.py @@ -44,6 +44,7 @@ class TimeEntryImporter(ToHarvest): supported_fields = [ 'id', 'user_id', + 'client_id', 'project_id', 'task_id', 'spent_date', @@ -72,6 +73,7 @@ class TimeEntryImporter(ToHarvest): def normalize_local_object(self, entry): data = { 'id': entry['id'], + 'client_id': entry['client']['id'], 'project_id': entry['project']['id'], 'task_id': entry['task']['id'], 'spent_date': entry['spent_date'], @@ -100,11 +102,14 @@ class TimeEntryImporter(ToHarvest): result = dict(host_data) if 'user_id' in self.fields: result['user'] = {'id': result['user_id']} + if 'client_id' in self.fields: + result['client'] = {'id': result['client_id']} result['project'] = {'id': result['project_id']} result['task'] = {'id': result['task_id']} return result kwargs = { + 'client_id': host_data['client_id'], 'project_id': host_data['project_id'], 'task_id': host_data['task_id'], 'spent_date': host_data['spent_date'],