Merge pull request #15372 from Zlash65/p-fix

[Minor] Patch Fix
This commit is contained in:
Zarrar 2018-09-10 12:21:02 +05:30 committed by GitHub
commit f42510eb54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,9 +16,9 @@ def execute():
fieldname = frappe.db.get_value('DocField', {'fieldname': 'production_order', 'parent': 'Timesheet'}, 'fieldname') fieldname = frappe.db.get_value('DocField', {'fieldname': 'production_order', 'parent': 'Timesheet'}, 'fieldname')
if not fieldname: return if not fieldname: return
for d in frappe.db.sql("""select %(fieldname)s, name from tabTimesheet for d in frappe.get_all('Timesheet',
where (%(fieldname)s is not null and %(fieldname)s != '') and docstatus = 0""", filters={fieldname: ['!=', ""], 'docstatus': 0},
{'fieldname': fieldname}, as_dict=1): fields=[fieldname, 'name']):
if d[fieldname]: if d[fieldname]:
doc = frappe.get_doc('Work Order', d[fieldname]) doc = frappe.get_doc('Work Order', d[fieldname])
for row in doc.operations: for row in doc.operations: