[project] added patch
This commit is contained in:
parent
9dd9bb0adf
commit
cdd265d3bf
5
patches/june_2013/p02_update_project_completed.py
Normal file
5
patches/june_2013/p02_update_project_completed.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import webnotes
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
for p in webnotes.conn.sql_list("""select name from tabProject"""):
|
||||||
|
webnotes.bean("Project", p).controller.update_percent_complete()
|
@ -258,4 +258,5 @@ patch_list = [
|
|||||||
"patches.may_2013.p07_move_update_stock_to_pos",
|
"patches.may_2013.p07_move_update_stock_to_pos",
|
||||||
"patches.may_2013.p08_change_item_wise_tax",
|
"patches.may_2013.p08_change_item_wise_tax",
|
||||||
"patches.june_2013.p01_update_bom_exploded_items",
|
"patches.june_2013.p01_update_bom_exploded_items",
|
||||||
|
"patches.june_2013.p02_update_project_completed",
|
||||||
]
|
]
|
@ -63,8 +63,9 @@ class DocType:
|
|||||||
def update_percent_complete(self):
|
def update_percent_complete(self):
|
||||||
total = webnotes.conn.sql("""select count(*) from tabTask where project=%s""",
|
total = webnotes.conn.sql("""select count(*) from tabTask where project=%s""",
|
||||||
self.doc.name)[0][0]
|
self.doc.name)[0][0]
|
||||||
completed = webnotes.conn.sql("""select count(*) from tabTask where
|
if total:
|
||||||
project=%s and status='Closed'""", self.doc.name)[0][0]
|
completed = webnotes.conn.sql("""select count(*) from tabTask where
|
||||||
webnotes.conn.set_value("Project", self.doc.name, "percent_complete",
|
project=%s and status='Closed'""", self.doc.name)[0][0]
|
||||||
int(float(completed) / total * 100))
|
webnotes.conn.set_value("Project", self.doc.name, "percent_complete",
|
||||||
|
int(float(completed) / total * 100))
|
||||||
|
|
||||||
|
19
projects/doctype/task/task_calendar.js
Normal file
19
projects/doctype/task/task_calendar.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
wn.views.calendar["Task"] = {
|
||||||
|
field_map: {
|
||||||
|
"start": "exp_start_date",
|
||||||
|
"end": "exp_end_date",
|
||||||
|
"id": "name",
|
||||||
|
"title": "subject",
|
||||||
|
"allDay": "allDay"
|
||||||
|
},
|
||||||
|
gantt: true,
|
||||||
|
filters: [
|
||||||
|
{
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "project",
|
||||||
|
"options": "Project",
|
||||||
|
"label": "Project"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
get_events_method: "projects.doctype.task.task.get_events"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user