I am actually trying to transfer the manufactured items from one warehouse to the other referring to particular production order , I understand there is some validation where once if the production order gets completed the production_order field for the completed production order will not work in stock entry doc and will also not fetch the item code automatically displaying a message that BOM and manufacturing quantity is required . But in my case till dispatch the item will travel to different warehouse even after the production order gets completed , so while transferring the materials from one warehouse to the other I want to track the items with the production order , for accomplishing this I tried writing a script but it is not working ,
Thanks for the reply @netchampfaris , I used frm.doc.production_order , but still I am getting the same error message that BOM and Manufacturing quantity is required and also it is not fetching the item_code to the stock entry item table .
Many thanks for the reply @KanchanChauhan . I tried doing that I am getting Uncaught Error: BOM and Manufacturing Quantity are required error in the console . Tried clicking on get items button , repeatedly getting the same message BOM and Manufacturing Quantity are required. Actually what happens is the qty field in the production order gets converted to fg_completed qty once the production order gets completed . No clue what I should do , any help would really be a life saver .
My problem is with this script in stock entry js file
get_items: function() {
var me = this;
if(!this.frm.doc.fg_completed_qty || !this.frm.doc.bom_no)
frappe.throw(__("BOM and Manufacturing Quantity are required"));