Merge pull request #33103 from rohitwaghchaure/fixed-job-card-for-qty-ux
fix: job card "Qty to Manufacture" UX
This commit is contained in:
commit
b0c8643517
@ -33,6 +33,11 @@ frappe.ui.form.on('Job Card', {
|
||||
return;
|
||||
}
|
||||
|
||||
let has_stock_entry = frm.doc.__onload &&
|
||||
frm.doc.__onload.has_stock_entry ? true : false;
|
||||
|
||||
frm.toggle_enable("for_quantity", !has_stock_entry);
|
||||
|
||||
if (!frm.is_new() && has_items && frm.doc.docstatus < 2) {
|
||||
let to_request = frm.doc.for_quantity > frm.doc.transferred_qty;
|
||||
let excess_transfer_allowed = frm.doc.__onload.job_card_excess_transfer;
|
||||
|
@ -57,6 +57,10 @@ class JobCard(Document):
|
||||
)
|
||||
self.set_onload("job_card_excess_transfer", excess_transfer)
|
||||
self.set_onload("work_order_closed", self.is_work_order_closed())
|
||||
self.set_onload("has_stock_entry", self.has_stock_entry())
|
||||
|
||||
def has_stock_entry(self):
|
||||
return frappe.db.exists("Stock Entry", {"job_card": self.name, "docstatus": ["!=", 2]})
|
||||
|
||||
def before_validate(self):
|
||||
self.set_wip_warehouse()
|
||||
|
Loading…
Reference in New Issue
Block a user