Fixed bom patch
This commit is contained in:
		
							parent
							
								
									22c9e42f4d
								
							
						
					
					
						commit
						4b83403a63
					
				| @ -5,8 +5,8 @@ from __future__ import unicode_literals | |||||||
| import frappe | import frappe | ||||||
| 
 | 
 | ||||||
| def execute(): | def execute(): | ||||||
| 	for d in frappe.db.sql("""select bom.name from `tabBOM` bom where bom.docstatus < 2 and  | 	for d in frappe.db.sql("""select bom.name from `tabBOM` bom where bom.docstatus < 2 and | ||||||
| 		exists(select bom_item.name from `tabBOM Operation` bom_op where  | 		exists(select bom_op.name from `tabBOM Operation` bom_op where | ||||||
| 		bom.name = bom_op.parent and bom_op.fixed_cycle_cost IS NOT NULL)""", as_dict=1): | 		bom.name = bom_op.parent and bom_op.fixed_cycle_cost IS NOT NULL)""", as_dict=1): | ||||||
| 		try: | 		try: | ||||||
| 			bom = frappe.get_doc('BOM', d.name) | 			bom = frappe.get_doc('BOM', d.name) | ||||||
| @ -16,4 +16,3 @@ def execute(): | |||||||
| 			frappe.db.commit() | 			frappe.db.commit() | ||||||
| 		except: | 		except: | ||||||
| 			frappe.db.rollback() | 			frappe.db.rollback() | ||||||
| 		 |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user