Merge pull request #32918 from s-aga-r/fix/github-issue/28336

fix: WO Skip Material Transfer to WIP Warehouse
This commit is contained in:
Sagar Sharma 2022-11-10 17:12:00 +05:30 committed by GitHub
commit e9306f3c75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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")

View File

@ -146,7 +146,7 @@ class WorkOrder(Document):
frappe.throw(_("Sales Order {0} is {1}").format(self.sales_order, status))
def set_default_warehouse(self):
if not self.wip_warehouse:
if not self.wip_warehouse and not self.skip_transfer:
self.wip_warehouse = frappe.db.get_single_value(
"Manufacturing Settings", "default_wip_warehouse"
)