feild rename fixes in Project

This commit is contained in:
Neil Trini Lasrado 2015-04-16 10:15:04 +05:30
parent e7ddb72e7f
commit 50a0fd6204
4 changed files with 6 additions and 14 deletions

View File

@ -27,7 +27,7 @@ frappe.ui.form.on("Project Task", "edit_task", function(frm, doctype, name) {
cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.refresh = function(doc) {
if(!doc.__islocal) { if(!doc.__islocal) {
cur_frm.add_custom_button(__("Gantt Chart"), function() { cur_frm.add_custom_button(__("Gantt Chart"), function() {
frappe.route_options = {"project": doc.name, "start": doc.project_start_date, "end": doc.completion_date}; frappe.route_options = {"project": doc.name, "start": doc.expected_start_date, "end": doc.expected_end_date};
frappe.set_route("Gantt", "Task"); frappe.set_route("Gantt", "Task");
}, "icon-tasks", true); }, "icon-tasks", true);
cur_frm.add_custom_button(__("Tasks"), function() { cur_frm.add_custom_button(__("Tasks"), function() {

View File

@ -25,14 +25,6 @@ class Project(Document):
"task_id": task.name "task_id": task.name
}) })
def get_gross_profit(self):
pft, per_pft =0, 0
pft = flt(self.project_value) - flt(self.est_material_cost)
#if pft > 0:
per_pft = (flt(pft) / flt(self.project_value)) * 100
ret = {'gross_margin_value': pft, 'per_gross_margin': per_pft}
return ret
def validate(self): def validate(self):
self.validate_dates() self.validate_dates()
self.sync_tasks() self.sync_tasks()

View File

@ -1,5 +1,5 @@
frappe.listview_settings['Project'] = { frappe.listview_settings['Project'] = {
add_fields: ["status", "priority", "is_active", "percent_complete", "completion_date"], add_fields: ["status", "priority", "is_active", "percent_complete", "expected_end_date"],
filters:[["status","=", "Open"]], filters:[["status","=", "Open"]],
get_indicator: function(doc) { get_indicator: function(doc) {
if(doc.status=="Open" && doc.percent_complete) { if(doc.status=="Open" && doc.percent_complete) {

View File

@ -17,8 +17,8 @@ def execute(filters=None):
data.append([project.name, pr_item_map.get(project.name, 0), data.append([project.name, pr_item_map.get(project.name, 0),
se_item_map.get(project.name, 0), dn_item_map.get(project.name, 0), se_item_map.get(project.name, 0), dn_item_map.get(project.name, 0),
project.project_name, project.status, project.company, project.project_name, project.status, project.company,
project.customer, project.project_value, project.project_start_date, project.customer, project.estimated_costing, project.expected_start_date,
project.completion_date]) project.expected_end_date])
return columns, data return columns, data
@ -30,8 +30,8 @@ def get_columns():
_("Project Start Date") + ":Date:120", _("Completion Date") + ":Date:120"] _("Project Start Date") + ":Date:120", _("Completion Date") + ":Date:120"]
def get_project_details(): def get_project_details():
return frappe.db.sql(""" select name, project_name, status, company, customer, project_value, return frappe.db.sql(""" select name, project_name, status, company, customer, estimated_costing,
project_start_date, completion_date from tabProject where docstatus < 2""", as_dict=1) expected_start_date, expected_end_date from tabProject where docstatus < 2""", as_dict=1)
def get_purchased_items_cost(): def get_purchased_items_cost():
pr_items = frappe.db.sql("""select project_name, sum(base_net_amount) as amount pr_items = frappe.db.sql("""select project_name, sum(base_net_amount) as amount