2015-03-03 09:25:30 +00:00
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
2014-10-10 13:18:09 +00:00
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
2014-10-14 06:42:40 +00:00
|
|
|
for d in frappe.db.sql("select name from `tabBOM` where docstatus < 2"):
|
2015-02-10 09:11:27 +00:00
|
|
|
try:
|
2014-10-10 13:18:09 +00:00
|
|
|
document = frappe.get_doc('BOM', d[0])
|
|
|
|
if document.docstatus == 1:
|
2015-02-10 09:11:27 +00:00
|
|
|
document.flags.ignore_validate_update_after_submit = True
|
2014-10-10 13:18:09 +00:00
|
|
|
document.calculate_cost()
|
|
|
|
document.save()
|
2014-10-14 06:42:40 +00:00
|
|
|
except:
|
2015-02-10 09:11:27 +00:00
|
|
|
pass
|