[Fix] Updated timesheet status
This commit is contained in:
parent
94dbc14f8a
commit
d07557eaf6
@ -314,3 +314,4 @@ erpnext.patches.v7_0.repost_future_gle_for_purchase_invoice
|
|||||||
erpnext.patches.v7_0.fix_duplicate_icons
|
erpnext.patches.v7_0.fix_duplicate_icons
|
||||||
erpnext.patches.v7_0.repost_gle_for_pos_sales_return
|
erpnext.patches.v7_0.repost_gle_for_pos_sales_return
|
||||||
erpnext.patches.v7_0.update_missing_employee_in_timesheet
|
erpnext.patches.v7_0.update_missing_employee_in_timesheet
|
||||||
|
erpnext.patches.v7_0.update_status_for_timesheet
|
||||||
@ -21,6 +21,7 @@ def execute():
|
|||||||
time_sheet.company = company
|
time_sheet.company = company
|
||||||
|
|
||||||
time_sheet.set_status()
|
time_sheet.set_status()
|
||||||
|
time_sheet.set_dates()
|
||||||
time_sheet.update_cost()
|
time_sheet.update_cost()
|
||||||
time_sheet.calculate_total_amounts()
|
time_sheet.calculate_total_amounts()
|
||||||
time_sheet.flags.ignore_validate = True
|
time_sheet.flags.ignore_validate = True
|
||||||
@ -34,7 +35,6 @@ def execute():
|
|||||||
time_sheet.update_production_order(time_sheet.name)
|
time_sheet.update_production_order(time_sheet.name)
|
||||||
time_sheet.update_task_and_project()
|
time_sheet.update_task_and_project()
|
||||||
|
|
||||||
|
|
||||||
def get_timelog_data(data):
|
def get_timelog_data(data):
|
||||||
return {
|
return {
|
||||||
'billable': data.billable,
|
'billable': data.billable,
|
||||||
|
|||||||
11
erpnext/patches/v7_0/update_status_for_timesheet.py
Normal file
11
erpnext/patches/v7_0/update_status_for_timesheet.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.db.sql("""update
|
||||||
|
`tabTimesheet` as ts,
|
||||||
|
(
|
||||||
|
select min(from_time)as from_time, max(to_time) as to_time, parent from `tabTimesheet Detail` group by parent
|
||||||
|
) as tsd
|
||||||
|
set ts.status = 'Submitted', ts.start_date = tsd.from_time, ts.end_date = tsd.to_time
|
||||||
|
where tsd.parent = ts.name and ts.status = 'Draft' and ts.docstatus =1""")
|
||||||
Loading…
x
Reference in New Issue
Block a user