Skip to content

Alternative workstation branch view#137

Merged
agritheory merged 14 commits into
version-15from
alternative-workstation-branch-view
Oct 13, 2025
Merged

Alternative workstation branch view#137
agritheory merged 14 commits into
version-15from
alternative-workstation-branch-view

Conversation

@IshwaryaM1030

@IshwaryaM1030 IshwaryaM1030 commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator

@IshwaryaM1030
IshwaryaM1030 changed the base branch from version-14 to version-15 September 29, 2025 11:59
@github-actions

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

1 similar comment
@github-actions

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@github-actions

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@agritheory
agritheory marked this pull request as draft September 30, 2025 12:14

@agritheory agritheory left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this page should be called "Alternative Workstations".

Let's add a link in the Work Order List to it:

	refresh: listview => {
		listview.page.add_custom_menu_item(
			$('[data-view]').parent(),
			__('Alternative Workstations'),
			() => frappe.set_route('/workstation-selection'),
			true,
			null,
			'branch'
		)
	},

And a custom button on the Work Order Form with the same route.

Comment thread inventory_tools/inventory_tools/overrides/workstation_chart.py
Comment thread inventory_tools/inventory_tools/overrides/workstation_chart.py Outdated
Comment thread inventory_tools/inventory_tools/overrides/workstation_chart.py Outdated
Comment thread inventory_tools/inventory_tools/overrides/workstation_chart.py Outdated
Comment thread inventory_tools/inventory_tools/overrides/workstation_chart.py Outdated
@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

3 similar comments
@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@agritheory

Copy link
Copy Markdown
Owner

@IshwaryaM1030 One more color-based request: Let's remove the word "Primary" from the primary workstation card and color code it as purple if it's not the default workstation as defined in the BOM (because an alternative workstation has already been selected)

@github-actions

github-actions Bot commented Oct 2, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@IshwaryaM1030
IshwaryaM1030 marked this pull request as ready for review October 2, 2025 10:22
@github-actions

github-actions Bot commented Oct 2, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@agritheory

Copy link
Copy Markdown
Owner

@IshwaryaM1030 There's a bug where once an alternative workstation is selected the user cannot see the workstation as configured on the BOM, which should be included. I think we need to change the lookup to include it.

image

@github-actions

github-actions Bot commented Oct 3, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@IshwaryaM1030

Copy link
Copy Markdown
Collaborator Author

@agritheory I have added the default BOM workstation after the alternative workstation is selected. But we can't identify which is default one now. So should we add any color or wording to identify which is default one.

Screenshot from 2025-10-03 15-08-48

@agritheory

Copy link
Copy Markdown
Owner

@IshwaryaM1030 Yes, grey is usually the default color. We should label it also since that's not much of a clue.

@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -13,7 +13,14 @@
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@agritheory

Copy link
Copy Markdown
Owner

@IshwaryaM1030 This looks great, lets review the track overrides and get it merged.

@github-actions

github-actions Bot commented Oct 9, 2025

Copy link
Copy Markdown

The following override methods have changed in the upstream repository:

update_work_order_qty in file erpnext/manufacturing/doctype/work_order/work_order.py has changed:

--- old
+++ new
@@ -23,7 +23,7 @@
 			if qty > completed_qty:
 				frappe.throw(
 					_(\"{0} ({1}) cannot be greater than planned quantity ({2}) in Work Order {3}\").format(
-						self.meta.get_label(fieldname), qty, completed_qty, self.name
+						_(self.meta.get_label(fieldname)), qty, completed_qty, self.name
 					),
 					StockOverProductionError,
 				)

validate_job_card in file erpnext/manufacturing/doctype/job_card/job_card.py has changed:

--- old
+++ new
@@ -12,6 +12,12 @@
 					bold(\"Job Card\"), get_link_to_form(\"Job Card\", self.name)
 				)
 			)
+		elif frappe.db.get_single_value(\"Manufacturing Settings\", \"enforce_time_logs\"):
+			for row in self.time_logs:
+				if not row.from_time or not row.to_time:
+					frappe.throw(
+						_(\"Row #{0}: From Time and To Time fields are required\").format(row.idx),
+					)
 
 		precision = self.precision(\"total_completed_qty\")
 		total_completed_qty = flt(

set_missing_item_details in file erpnext/controllers/accounts_controller.py has changed:

--- old
+++ new
@@ -52,6 +52,13 @@
 								)
 							):
 								item.set(fieldname, value)
+
+								if fieldname == \"batch_no\" and item.batch_no and not item.is_free_item:
+									if ret.get(\"rate\"):
+										item.set(\"rate\", ret.get(\"rate\"))
+
+									if not item.get(\"price_list_rate\") and ret.get(\"price_list_rate\"):
+										item.set(\"price_list_rate\", ret.get(\"price_list_rate\"))
 
 							elif fieldname in [\"cost_center\", \"conversion_factor\"] and not item.get(
 								fieldname

get_item_details in file erpnext/stock/get_item_details.py has changed:

--- old
+++ new
@@ -61,6 +61,15 @@
 
 	out.update(get_price_list_rate(args, item))
 
+	if (
+		not out.price_list_rate
+		and args.transaction_type == \"selling\"
+		and frappe.get_single_value(\"Selling Settings\", \"fallback_to_default_price_list\")
+	):
+		fallback_args = args.copy()
+		fallback_args.price_list = frappe.get_single_value(\"Selling Settings\", \"selling_price_list\")
+		out.update(get_price_list_rate(fallback_args, item))
+
 	args.customer = current_customer
 
 	if args.customer and cint(args.is_pos):

validate_finished_goods in file erpnext/stock/doctype/stock_entry/stock_entry.py has changed:

--- old
+++ new
@@ -21,12 +21,6 @@
 					frappe.throw(
 						_(\"Finished Item {0} does not match with Work Order {1}\").format(
 							d.item_code, self.work_order
-						)
-					)
-				elif flt(d.transfer_qty) > flt(self.fg_completed_qty):
-					frappe.throw(
-						_(\"Quantity in row {0} ({1}) must be same as manufactured quantity {2}\").format(
-							d.idx, d.transfer_qty, self.fg_completed_qty
 						)
 					)
 

make_work_order_for_subassembly_items in file erpnext/manufacturing/doctype/production_plan/production_plan.py has changed:

--- old
+++ new
@@ -10,10 +10,18 @@
 			work_order_data = {
 				\"wip_warehouse\": default_warehouses.get(\"wip_warehouse\"),
 				\"fg_warehouse\": default_warehouses.get(\"fg_warehouse\"),
+				\"scrap_warehouse\": default_warehouses.get(\"scrap_warehouse\"),
 				\"company\": self.get(\"company\"),
 			}
 
+			if flt(row.qty) <= flt(row.ordered_qty):
+				continue
+
 			self.prepare_data_for_sub_assembly_items(row, work_order_data)
+
+			if work_order_data.get(\"qty\") <= 0:
+				continue
+
 			work_order = self.create_work_order(work_order_data)
 			if work_order:
 				wo_list.append(work_order)

@IshwaryaM1030
IshwaryaM1030 force-pushed the alternative-workstation-branch-view branch from 6926aee to 76501dc Compare October 9, 2025 10:58
@agritheory
agritheory merged commit 4916c50 into version-15 Oct 13, 2025
7 checks passed
@agritheory
agritheory deleted the alternative-workstation-branch-view branch October 13, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants