Skip to content

Commit

Permalink
fix: set WIP Warehouse in Job Card
Browse files Browse the repository at this point in the history
(cherry picked from commit e7fa2e0)
  • Loading branch information
s-aga-r authored and mergify[bot] committed Nov 10, 2022
1 parent 4a17711 commit f09e427
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions erpnext/manufacturing/doctype/job_card/job_card.py
Expand Up @@ -54,6 +54,9 @@ def onload(self):
self.set_onload("job_card_excess_transfer", excess_transfer)
self.set_onload("work_order_stopped", self.is_work_order_stopped())

def before_validate(self):
self.set_wip_warehouse()

def validate(self):
self.validate_time_logs()
self.set_status()
Expand Down Expand Up @@ -639,6 +642,12 @@ def set_status(self, update_status=False):
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")
Expand Down

0 comments on commit f09e427

Please sign in to comment.