Closed revant closed 3 years ago
Note:
my work order has only 1 element, and it causes the extra comma due to python tuple
work_orders = ('WO-Craft-Reliance Hosur-1-08-21-002-001',)
I hacked up the section for patch to run
stock_entries = frappe.db.sql_list('''
SELECT
se.name
FROM
`tabStock Entry` se
WHERE
se.purpose = 'Manufacture' and se.docstatus < 2 and se.work_order in ('{work_orders}')
and not exists(
select name from `tabStock Entry Detail` sed where sed.parent = se.name and sed.is_finished_item = 1
)
Order BY
se.posting_date, se.posting_time
'''.format(work_orders=work_orders[0]))
Site has no customization