diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 59fdf703a36..97eca54fe10 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -66,7 +66,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ }); } - if(this.frm.fields_dict["packed_items"].grid.get_field('batch_no')) { + if(this.frm.fields_dict["packed_items"] && + this.frm.fields_dict["packed_items"].grid.get_field('batch_no')) { this.frm.set_query("batch_no", "packed_items", function(doc, cdt, cdn) { return me.set_query_for_batch(doc, cdt, cdn) });