Merge pull request #16286 from rohitwaghchaure/fixed_patch_rename_bom_wo_fields
[Fix] Patch rename_bom_wo_fields
This commit is contained in:
		
						commit
						56c5d8b784
					
				| @ -1121,7 +1121,7 @@ | ||||
|  "issingle": 0, | ||||
|  "istable": 1, | ||||
|  "max_attachments": 0, | ||||
|  "modified": "2018-11-22 15:04:55.187136", | ||||
|  "modified": "2018-12-26 15:04:56.187136", | ||||
|  "modified_by": "Administrator", | ||||
|  "module": "Manufacturing", | ||||
|  "name": "BOM Item", | ||||
|  | ||||
| @ -8,7 +8,19 @@ from frappe.model.utils.rename_field import rename_field | ||||
| def execute(): | ||||
|     for doctype in ['BOM Explosion Item', 'BOM Item', 'Work Order Item', 'Item']: | ||||
|         if frappe.db.has_column(doctype, 'allow_transfer_for_manufacture'): | ||||
|             rename_field('BOM Item', "allow_transfer_for_manufacture", "include_item_in_manufacturing") | ||||
|             if doctype != 'Item': | ||||
|                 frappe.reload_doc('manufacturing', 'doctype', frappe.scrub(doctype)) | ||||
|             else: | ||||
|                 frappe.reload_doc('stock', 'doctype', frappe.scrub(doctype)) | ||||
| 
 | ||||
|             rename_field(doctype, "allow_transfer_for_manufacture", "include_item_in_manufacturing") | ||||
| 
 | ||||
|     if frappe.db.has_column('BOM', 'allow_same_item_multiple_times'): | ||||
|         frappe.db.sql(""" UPDATE tabBOM | ||||
|             SET | ||||
|                 allow_same_item_multiple_times = 0 | ||||
|             WHERE | ||||
|                 trim(coalesce(allow_same_item_multiple_times, '')) = '' """) | ||||
| 
 | ||||
|     for doctype in ['BOM', 'Work Order']: | ||||
|         frappe.reload_doc('manufacturing', 'doctype', frappe.scrub(doctype)) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user