# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe

def execute():
	for p in frappe.get_all("Project", filters={"docstatus": 0}):
		project = frappe.get_doc("Project", p.name)
		project.update_purchase_costing()
		project.save()
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe

def execute():
	for p in frappe.get_all("Project"):
		project = frappe.get_doc("Project", p.name)
		project.update_purchase_costing()
		project.save()
--- 
+++ 
@@ -5,7 +5,7 @@
 import frappe
 
 def execute():
-	for p in frappe.get_all("Project"):
+	for p in frappe.get_all("Project", filters={"docstatus": 0}):
 		project = frappe.get_doc("Project", p.name)
 		project.update_purchase_costing()
 		project.save()
[fix] Update project cost for draft project only
