Add logic to fetch single Harvest time entry via API
for one-off imports
This commit is contained in:
parent
aa87ce57be
commit
fe0daf00bc
|
@ -79,6 +79,12 @@ class TimeEntryImporter(ToHarvest):
|
||||||
cache[key] = normal
|
cache[key] = normal
|
||||||
return cache
|
return cache
|
||||||
|
|
||||||
|
def get_single_local_object(self, key):
|
||||||
|
assert len(self.key) == 1 and self.key[0] == 'id'
|
||||||
|
entry_id = key[0]
|
||||||
|
if entry_id > 0:
|
||||||
|
return self.webapi.get_time_entry(entry_id)
|
||||||
|
|
||||||
def normalize_local_object(self, entry):
|
def normalize_local_object(self, entry):
|
||||||
data = {
|
data = {
|
||||||
'id': entry['id'],
|
'id': entry['id'],
|
||||||
|
|
Loading…
Reference in a new issue