fix(India): Default value for export type
This commit is contained in:
		
							parent
							
								
									f60cba28ab
								
							
						
					
					
						commit
						328444b530
					
				| @ -293,3 +293,4 @@ erpnext.patches.v13_0.update_job_card_details | ||||
| erpnext.patches.v13_0.update_level_in_bom #1234sswef | ||||
| erpnext.patches.v13_0.add_missing_fg_item_for_stock_entry | ||||
| erpnext.patches.v13_0.update_subscription_status_in_memberships | ||||
| erpnext.patches.v13_0.update_export_type_for_gst | ||||
|  | ||||
							
								
								
									
										24
									
								
								erpnext/patches/v13_0/update_export_type_for_gst.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								erpnext/patches/v13_0/update_export_type_for_gst.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | ||||
| import frappe | ||||
| 
 | ||||
| def execute(): | ||||
| 	company = frappe.get_all('Company', filters = {'country': 'India'}) | ||||
| 	if not company: | ||||
| 		return | ||||
| 
 | ||||
| 	# Update custom fields | ||||
| 	fieldname = frappe.db.get_value('Custom Field', {'dt': 'Customer', 'fieldname': 'export_type'}) | ||||
| 	if fieldname: | ||||
| 		frappe.db.set_value('Custom Field', fieldname, 'default', '') | ||||
| 
 | ||||
| 	fieldname = frappe.db.get_value('Custom Field', {'dt': 'Supplier', 'fieldname': 'export_type'}) | ||||
| 	if fieldname: | ||||
| 		frappe.db.set_value('Custom Field', fieldname, 'default', '') | ||||
| 
 | ||||
| 	# Update Customer/Supplier Masters | ||||
| 	frappe.db.sql(""" | ||||
| 		UPDATE `tabCustomer` set export_type = '' WHERE gst_category NOT IN ('SEZ', 'Overseas', 'Deemed Export') | ||||
| 	""") | ||||
| 
 | ||||
| 	frappe.db.sql(""" | ||||
| 		UPDATE `tabSupplier` set export_type = '' WHERE gst_category NOT IN ('SEZ', 'Overseas') | ||||
| 	""") | ||||
| @ -641,7 +641,6 @@ def make_custom_fields(update=True): | ||||
| 				'label': 'Export Type', | ||||
| 				'fieldtype': 'Select', | ||||
| 				'insert_after': 'gst_category', | ||||
| 				'default': 'Without Payment of Tax', | ||||
| 				'depends_on':'eval:in_list(["SEZ", "Overseas"], doc.gst_category)', | ||||
| 				'options': '\nWith Payment of Tax\nWithout Payment of Tax' | ||||
| 			} | ||||
| @ -660,7 +659,6 @@ def make_custom_fields(update=True): | ||||
| 				'label': 'Export Type', | ||||
| 				'fieldtype': 'Select', | ||||
| 				'insert_after': 'gst_category', | ||||
| 				'default': 'Without Payment of Tax', | ||||
| 				'depends_on':'eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)', | ||||
| 				'options': '\nWith Payment of Tax\nWithout Payment of Tax' | ||||
| 			} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user