Hallo,
ich möchte über die Rest API ein neues Timesheet erstellen und bekomme folgende Fehlermeldung zurück:
├──● ->exception = AttributeError: ‘str’ object has no attribute ‘from_time’(TXT)
└──● ->exc = “Traceback (most recent call last):\n File "apps/frappe/frappe/app.py", line 68, in application\n response = frappe.api.handle()\n File "apps/frappe/frappe/api.py", line 140, in handle\n doc = frappe.get_doc(data).insert()\n File "apps/frappe/frappe/model/document.py", line 240, in insert\n self.run_before_save_methods()\n File "apps/frappe/frappe/model/document.py", line 971, in run_before_save_methods\n self.run_method("validate")\n File "apps/frappe/frappe/model/document.py", line 869, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File "apps/frappe/frappe/model/document.py", line 1161, in composer\n return composed(self, method, *args, **kwargs)\n File "apps/frappe/frappe/model/document.py", line 1144, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File "apps/frappe/frappe/model/document.py", line 863, in \n fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\n File "apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py", line 26, in validate\n self.validate_dates()\n File "apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py", line 134, in validate_dates\n if data.from_time and data.to_time and time_diff_in_hours(data.to_time, data.from_time) < 0:\nAttributeError: ‘str’ object has no attribute ‘from_time’\n”
Kann mir leider nicht erklären woran es liegt. Die übergebene Daten sind vollständig:
● ARRAY
├──● [owner] = HR-EMP-00001(TXT)
├──● [employee] = HR-EMP-00001(TXT)
├──● [start_date] = 2022-06-20(TXT)
├──● [end_date] = 2022-06-20(TXT)
├──● [title] = 2022-06-20(TXT)
└──● [time_logs] = ● ARRAY
├──● [activity_type] = B1(TXT)
├──● [description] = dfssdffsdsfsff(TXT)
├──● [employee] = HR-EMP-00001(TXT)
├──● [from_time] = 2022-06-20 08:15:00(TXT)
├──● [is_billable] = 1 (INT)
├──● [project] = fds(TXT)
├──● [to_time] = 2022-06-20 11:00:00(TXT)
├──● [billing_hours] = 2.75 (FLOAT)
└──● [hours] = 2.75 (FLOAT)
ERP Version 13.
Wäre über ein Tipp oder eine Lösung sehr dankbar!