fix(patch): Enable CWIP Accounting
This commit is contained in:
		
							parent
							
								
									3e515e704d
								
							
						
					
					
						commit
						9ffa9d4a64
					
				| @ -9,13 +9,12 @@ def execute(): | ||||
| 
 | ||||
| 	if frappe.db.exists("DocType","Asset Settings"): | ||||
| 		frappe.reload_doctype("Company") | ||||
| 		cwip_value = frappe.db.sql(""" SELECT value FROM `tabSingles` WHERE doctype='Asset Settings' | ||||
| 			and field='disable_cwip_accounting' """, as_dict=1) | ||||
| 		cwip_value = frappe.db.get_single_value("Asset Settings","disable_cwip_accounting") | ||||
| 
 | ||||
| 		companies = [x['name'] for x in frappe.get_all("Company", "name")] | ||||
| 		for company in companies: | ||||
| 			enable_cwip_accounting = cint(not cint(cwip_value[0]['value'])) | ||||
| 			frappe.set_value("Company", company, "enable_cwip_accounting", enable_cwip_accounting) | ||||
| 			enable_cwip_accounting = cint(not cint(cwip_value)) | ||||
| 			frappe.db.set_value("Company", company, "enable_cwip_accounting", enable_cwip_accounting) | ||||
| 
 | ||||
| 		frappe.db.sql( | ||||
| 			""" DELETE FROM `tabSingles` where doctype = 'Asset Settings' """) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user