diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index fb94e8aa99..75e652e251 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -54,6 +54,9 @@ class JobCard(Document): self.set_onload("job_card_excess_transfer", excess_transfer) self.set_onload("work_order_closed", self.is_work_order_closed()) + def before_validate(self): + self.set_wip_warehouse() + def validate(self): self.validate_time_logs() self.set_status() @@ -639,6 +642,12 @@ class JobCard(Document): if update_status: self.db_set("status", self.status) + def set_wip_warehouse(self): + if not self.wip_warehouse: + self.wip_warehouse = frappe.db.get_single_value( + "Manufacturing Settings", "default_wip_warehouse" + ) + def validate_operation_id(self): if ( self.get("operation_id")