fix: validation of job card in stock entry
This commit is contained in:
		
							parent
							
								
									e816ed89e6
								
							
						
					
					
						commit
						c697cb8b2d
					
				| @ -267,6 +267,17 @@ class JobCard(Document): | |||||||
| 			fields = ["sum(total_time_in_mins) as time_in_mins", "sum(total_completed_qty) as completed_qty"], | 			fields = ["sum(total_time_in_mins) as time_in_mins", "sum(total_completed_qty) as completed_qty"], | ||||||
| 			filters = {"docstatus": 1, "work_order": self.work_order, "operation_id": self.operation_id}) | 			filters = {"docstatus": 1, "work_order": self.work_order, "operation_id": self.operation_id}) | ||||||
| 
 | 
 | ||||||
|  | 	def set_transferred_qty_in_job_card(self, ste_doc): | ||||||
|  | 		for row in ste_doc.items: | ||||||
|  | 			if not row.job_card_item: continue | ||||||
|  | 
 | ||||||
|  | 			qty = frappe.db.sql(""" SELECT SUM(qty) from `tabStock Entry Detail` sed, `tabStock Entry` se | ||||||
|  | 				WHERE  sed.job_card_item = %s and se.docstatus = 1 and sed.parent = se.name and | ||||||
|  | 				se.purpose = 'Material Transfer for Manufacture' | ||||||
|  | 			""", (row.job_card_item))[0][0] | ||||||
|  | 
 | ||||||
|  | 			frappe.db.set_value('Job Card Item', row.job_card_item, 'transferred_qty', flt(qty)) | ||||||
|  | 
 | ||||||
| 	def set_transferred_qty(self, update_status=False): | 	def set_transferred_qty(self, update_status=False): | ||||||
| 		if not self.items: | 		if not self.items: | ||||||
| 			self.transferred_qty = self.for_quantity if self.docstatus == 1 else 0 | 			self.transferred_qty = self.for_quantity if self.docstatus == 1 else 0 | ||||||
| @ -279,7 +290,8 @@ class JobCard(Document): | |||||||
| 			self.transferred_qty = frappe.db.get_value('Stock Entry', { | 			self.transferred_qty = frappe.db.get_value('Stock Entry', { | ||||||
| 				'job_card': self.name, | 				'job_card': self.name, | ||||||
| 				'work_order': self.work_order, | 				'work_order': self.work_order, | ||||||
| 				'docstatus': 1 | 				'docstatus': 1, | ||||||
|  | 				'purpose': 'Material Transfer for Manufacture' | ||||||
| 			}, 'sum(fg_completed_qty)') or 0 | 			}, 'sum(fg_completed_qty)') or 0 | ||||||
| 
 | 
 | ||||||
| 		self.db_set("transferred_qty", self.transferred_qty) | 		self.db_set("transferred_qty", self.transferred_qty) | ||||||
| @ -420,6 +432,7 @@ def make_stock_entry(source_name, target_doc=None): | |||||||
| 		target.purpose = "Material Transfer for Manufacture" | 		target.purpose = "Material Transfer for Manufacture" | ||||||
| 		target.from_bom = 1 | 		target.from_bom = 1 | ||||||
| 		target.fg_completed_qty = source.get('for_quantity', 0) - source.get('transferred_qty', 0) | 		target.fg_completed_qty = source.get('for_quantity', 0) - source.get('transferred_qty', 0) | ||||||
|  | 		target.set_transfer_qty() | ||||||
| 		target.calculate_rate_and_amount() | 		target.calculate_rate_and_amount() | ||||||
| 		target.set_missing_values() | 		target.set_missing_values() | ||||||
| 		target.set_stock_entry_type() | 		target.set_stock_entry_type() | ||||||
| @ -437,9 +450,10 @@ def make_stock_entry(source_name, target_doc=None): | |||||||
| 			"field_map": { | 			"field_map": { | ||||||
| 				"source_warehouse": "s_warehouse", | 				"source_warehouse": "s_warehouse", | ||||||
| 				"required_qty": "qty", | 				"required_qty": "qty", | ||||||
| 				"uom": "stock_uom" | 				"name": "job_card_item" | ||||||
| 			}, | 			}, | ||||||
| 			"postprocess": update_item, | 			"postprocess": update_item, | ||||||
|  | 			"condition": lambda doc: doc.required_qty > 0 | ||||||
| 		} | 		} | ||||||
| 	}, target_doc, set_missing_values) | 	}, target_doc, set_missing_values) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,363 +1,120 @@ | |||||||
| { | { | ||||||
|  "allow_copy": 0,  |  "actions": [], | ||||||
|  "allow_guest_to_view": 0,  |  | ||||||
|  "allow_import": 0,  |  | ||||||
|  "allow_rename": 0,  |  | ||||||
|  "beta": 0,  |  | ||||||
|  "creation": "2018-07-09 17:20:44.737289", |  "creation": "2018-07-09 17:20:44.737289", | ||||||
|  "custom": 0,  |  | ||||||
|  "docstatus": 0,  |  | ||||||
|  "doctype": "DocType", |  "doctype": "DocType", | ||||||
|  "document_type": "",  |  | ||||||
|  "editable_grid": 1, |  "editable_grid": 1, | ||||||
|  "engine": "InnoDB", |  "engine": "InnoDB", | ||||||
|  |  "field_order": [ | ||||||
|  |   "item_code", | ||||||
|  |   "source_warehouse", | ||||||
|  |   "uom", | ||||||
|  |   "item_group", | ||||||
|  |   "column_break_3", | ||||||
|  |   "stock_uom", | ||||||
|  |   "item_name", | ||||||
|  |   "description", | ||||||
|  |   "qty_section", | ||||||
|  |   "required_qty", | ||||||
|  |   "column_break_9", | ||||||
|  |   "transferred_qty", | ||||||
|  |   "allow_alternative_item" | ||||||
|  |  ], | ||||||
|  "fields": [ |  "fields": [ | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "item_code", |    "fieldname": "item_code", | ||||||
|    "fieldtype": "Link", |    "fieldtype": "Link", | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 1, |    "in_list_view": 1, | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "label": "Item Code", |    "label": "Item Code", | ||||||
|    "length": 0,  |  | ||||||
|    "no_copy": 0,  |  | ||||||
|    "options": "Item", |    "options": "Item", | ||||||
|    "permlevel": 0,  |    "read_only": 1 | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 1,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "source_warehouse", |    "fieldname": "source_warehouse", | ||||||
|    "fieldtype": "Link", |    "fieldtype": "Link", | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 1, |    "ignore_user_permissions": 1, | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 1, |    "in_list_view": 1, | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "label": "Source Warehouse", |    "label": "Source Warehouse", | ||||||
|    "length": 0,  |    "options": "Warehouse" | ||||||
|    "no_copy": 0,  |  | ||||||
|    "options": "Warehouse",  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 0,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "uom", |    "fieldname": "uom", | ||||||
|    "fieldtype": "Link", |    "fieldtype": "Link", | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 0,  |  | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "label": "UOM", |    "label": "UOM", | ||||||
|    "length": 0,  |    "options": "UOM" | ||||||
|    "no_copy": 0,  |  | ||||||
|    "options": "UOM",  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 0,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "column_break_3", |    "fieldname": "column_break_3", | ||||||
|    "fieldtype": "Column Break",  |    "fieldtype": "Column Break" | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 0,  |  | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "length": 0,  |  | ||||||
|    "no_copy": 0,  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 0,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "item_name", |    "fieldname": "item_name", | ||||||
|    "fieldtype": "Data", |    "fieldtype": "Data", | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 0,  |  | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "label": "Item Name", |    "label": "Item Name", | ||||||
|    "length": 0,  |    "read_only": 1 | ||||||
|    "no_copy": 0,  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 1,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "description", |    "fieldname": "description", | ||||||
|    "fieldtype": "Text", |    "fieldtype": "Text", | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 0,  |  | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "label": "Description", |    "label": "Description", | ||||||
|    "length": 0,  |    "read_only": 1 | ||||||
|    "no_copy": 0,  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 1,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "qty_section", |    "fieldname": "qty_section", | ||||||
|    "fieldtype": "Section Break", |    "fieldtype": "Section Break", | ||||||
|    "hidden": 0,  |    "label": "Qty" | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 0,  |  | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "label": "Qty",  |  | ||||||
|    "length": 0,  |  | ||||||
|    "no_copy": 0,  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 0,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "required_qty", |    "fieldname": "required_qty", | ||||||
|    "fieldtype": "Float", |    "fieldtype": "Float", | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 1, |    "in_list_view": 1, | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "label": "Required Qty", |    "label": "Required Qty", | ||||||
|    "length": 0,  |    "read_only": 1 | ||||||
|    "no_copy": 0,  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 1,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |  | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "column_break_9", |    "fieldname": "column_break_9", | ||||||
|    "fieldtype": "Column Break",  |    "fieldtype": "Column Break" | ||||||
|    "hidden": 0,  |  | ||||||
|    "ignore_user_permissions": 0,  |  | ||||||
|    "ignore_xss_filter": 0,  |  | ||||||
|    "in_filter": 0,  |  | ||||||
|    "in_global_search": 0,  |  | ||||||
|    "in_list_view": 0,  |  | ||||||
|    "in_standard_filter": 0,  |  | ||||||
|    "length": 0,  |  | ||||||
|    "no_copy": 0,  |  | ||||||
|    "permlevel": 0,  |  | ||||||
|    "precision": "",  |  | ||||||
|    "print_hide": 0,  |  | ||||||
|    "print_hide_if_no_value": 0,  |  | ||||||
|    "read_only": 0,  |  | ||||||
|    "remember_last_selected_value": 0,  |  | ||||||
|    "report_hide": 0,  |  | ||||||
|    "reqd": 0,  |  | ||||||
|    "search_index": 0,  |  | ||||||
|    "set_only_once": 0,  |  | ||||||
|    "translatable": 0,  |  | ||||||
|    "unique": 0 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|    "allow_bulk_edit": 0,  |    "default": "0", | ||||||
|    "allow_in_quick_entry": 0,  |  | ||||||
|    "allow_on_submit": 0,  |  | ||||||
|    "bold": 0,  |  | ||||||
|    "collapsible": 0,  |  | ||||||
|    "columns": 0,  |  | ||||||
|    "fieldname": "allow_alternative_item", |    "fieldname": "allow_alternative_item", | ||||||
|    "fieldtype": "Check", |    "fieldtype": "Check", | ||||||
|    "hidden": 0,  |    "label": "Allow Alternative Item" | ||||||
|    "ignore_user_permissions": 0,  |   }, | ||||||
|    "ignore_xss_filter": 0,  |   { | ||||||
|    "in_filter": 0,  |    "fetch_from": "item_code.item_group", | ||||||
|    "in_global_search": 0,  |    "fieldname": "item_group", | ||||||
|    "in_list_view": 0,  |    "fieldtype": "Link", | ||||||
|    "in_standard_filter": 0,  |    "label": "Item Group", | ||||||
|    "label": "Allow Alternative Item",  |    "options": "Item Group", | ||||||
|    "length": 0,  |    "read_only": 1 | ||||||
|    "no_copy": 0,  |   }, | ||||||
|    "permlevel": 0,  |   { | ||||||
|    "precision": "",  |    "fetch_from": "item_code.stock_uom", | ||||||
|    "print_hide": 0,  |    "fieldname": "stock_uom", | ||||||
|    "print_hide_if_no_value": 0,  |    "fieldtype": "Link", | ||||||
|    "read_only": 0,  |    "label": "Stock UOM", | ||||||
|    "remember_last_selected_value": 0,  |    "options": "UOM" | ||||||
|    "report_hide": 0,  |   }, | ||||||
|    "reqd": 0,  |   { | ||||||
|    "search_index": 0,  |    "fieldname": "transferred_qty", | ||||||
|    "set_only_once": 0,  |    "fieldtype": "Float", | ||||||
|    "translatable": 0,  |    "label": "Transferred Qty", | ||||||
|    "unique": 0 |    "no_copy": 1, | ||||||
|  |    "print_hide": 1, | ||||||
|  |    "read_only": 1 | ||||||
|   } |   } | ||||||
|  ], |  ], | ||||||
|  "has_web_view": 0,  |  "index_web_pages_for_search": 1, | ||||||
|  "hide_heading": 0,  |  | ||||||
|  "hide_toolbar": 0,  |  | ||||||
|  "idx": 0,  |  | ||||||
|  "image_view": 0,  |  | ||||||
|  "in_create": 0,  |  | ||||||
|  "is_submittable": 0,  |  | ||||||
|  "issingle": 0,  |  | ||||||
|  "istable": 1, |  "istable": 1, | ||||||
|  "max_attachments": 0,  |  "links": [], | ||||||
|  "modified": "2018-08-28 15:23:48.099459",  |  "modified": "2021-02-11 13:50:13.804108", | ||||||
|  "modified_by": "Administrator", |  "modified_by": "Administrator", | ||||||
|  "module": "Manufacturing", |  "module": "Manufacturing", | ||||||
|  "name": "Job Card Item", |  "name": "Job Card Item", | ||||||
|  "name_case": "",  |  | ||||||
|  "owner": "Administrator", |  "owner": "Administrator", | ||||||
|  "permissions": [], |  "permissions": [], | ||||||
|  "quick_entry": 1, |  "quick_entry": 1, | ||||||
|  "read_only": 0,  |  | ||||||
|  "read_only_onload": 0,  |  | ||||||
|  "show_name_in_global_search": 0,  |  | ||||||
|  "sort_field": "modified", |  "sort_field": "modified", | ||||||
|  "sort_order": "DESC", |  "sort_order": "DESC", | ||||||
|  "track_changes": 1,  |  "track_changes": 1 | ||||||
|  "track_seen": 0,  |  | ||||||
|  "track_views": 0 |  | ||||||
| } | } | ||||||
| @ -163,7 +163,7 @@ class StockEntry(StockController): | |||||||
| 		if self.purpose not in valid_purposes: | 		if self.purpose not in valid_purposes: | ||||||
| 			frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes))) | 			frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes))) | ||||||
| 
 | 
 | ||||||
| 		if self.job_card and self.purpose != 'Material Transfer for Manufacture': | 		if self.job_card and self.purpose not in ['Material Transfer for Manufacture', 'Repack']: | ||||||
| 			frappe.throw(_("For job card {0}, you can only make the 'Material Transfer for Manufacture' type stock entry") | 			frappe.throw(_("For job card {0}, you can only make the 'Material Transfer for Manufacture' type stock entry") | ||||||
| 				.format(self.job_card)) | 				.format(self.job_card)) | ||||||
| 
 | 
 | ||||||
| @ -823,6 +823,7 @@ class StockEntry(StockController): | |||||||
| 		if self.job_card: | 		if self.job_card: | ||||||
| 			job_doc = frappe.get_doc('Job Card', self.job_card) | 			job_doc = frappe.get_doc('Job Card', self.job_card) | ||||||
| 			job_doc.set_transferred_qty(update_status=True) | 			job_doc.set_transferred_qty(update_status=True) | ||||||
|  | 			job_doc.set_transferred_qty_in_job_card(self) | ||||||
| 
 | 
 | ||||||
| 		if self.work_order: | 		if self.work_order: | ||||||
| 			pro_doc = frappe.get_doc("Work Order", self.work_order) | 			pro_doc = frappe.get_doc("Work Order", self.work_order) | ||||||
|  | |||||||
| @ -69,7 +69,8 @@ | |||||||
|   "putaway_rule", |   "putaway_rule", | ||||||
|   "column_break_51", |   "column_break_51", | ||||||
|   "reference_purchase_receipt", |   "reference_purchase_receipt", | ||||||
|   "quality_inspection" |   "quality_inspection", | ||||||
|  |   "job_card_item" | ||||||
|  ], |  ], | ||||||
|  "fields": [ |  "fields": [ | ||||||
|   { |   { | ||||||
| @ -532,13 +533,22 @@ | |||||||
|    "fieldname": "is_finished_item", |    "fieldname": "is_finished_item", | ||||||
|    "fieldtype": "Check", |    "fieldtype": "Check", | ||||||
|    "label": "Is Finished Item" |    "label": "Is Finished Item" | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |    "fieldname": "job_card_item", | ||||||
|  |    "fieldtype": "Data", | ||||||
|  |    "hidden": 1, | ||||||
|  |    "label": "Job Card Item", | ||||||
|  |    "no_copy": 1, | ||||||
|  |    "print_hide": 1, | ||||||
|  |    "read_only": 1 | ||||||
|   } |   } | ||||||
|  ], |  ], | ||||||
|  "idx": 1, |  "idx": 1, | ||||||
|  "index_web_pages_for_search": 1, |  "index_web_pages_for_search": 1, | ||||||
|  "istable": 1, |  "istable": 1, | ||||||
|  "links": [], |  "links": [], | ||||||
|  "modified": "2020-12-30 15:00:44.489442", |  "modified": "2021-02-11 13:47:50.158754", | ||||||
|  "modified_by": "Administrator", |  "modified_by": "Administrator", | ||||||
|  "module": "Stock", |  "module": "Stock", | ||||||
|  "name": "Stock Entry Detail", |  "name": "Stock Entry Detail", | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user