From 0d20d6fdd2658f39e3f10c9753b9002e46b99992 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 4 Mar 2013 15:35:45 +0530 Subject: [PATCH] fixes for purchase price list --- accounts/doctype/purchase_invoice/purchase_invoice.js | 9 ++++++--- buying/doctype/purchase_order/purchase_order.js | 9 ++++++--- buying/doctype/supplier_quotation/supplier_quotation.js | 9 ++++++--- stock/doctype/purchase_receipt/purchase_receipt.js | 8 +++++--- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.js b/accounts/doctype/purchase_invoice/purchase_invoice.js index b4fe62e3b6..f4a2e68e5f 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -44,9 +44,12 @@ erpnext.buying.PurchaseInvoiceController = erpnext.buying.BuyingController.exten } // TODO: improve this - if(this.frm.doc.__islocal && this.frm.fields_dict.price_list_name - && this.frm.doc.price_list_name) { - this.price_list_name(callback1); + if(this.frm.doc.__islocal) { + if (this.frm.fields_dict.price_list_name && this.frm.doc.price_list_name) { + this.price_list_name(callback1); + } else { + callback1(doc, dt, dn); + } } } }); diff --git a/buying/doctype/purchase_order/purchase_order.js b/buying/doctype/purchase_order/purchase_order.js index 4bcd828899..afe4741c86 100644 --- a/buying/doctype/purchase_order/purchase_order.js +++ b/buying/doctype/purchase_order/purchase_order.js @@ -50,9 +50,12 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( } // TODO: improve this - if(this.frm.doc.__islocal && this.frm.fields_dict.price_list_name - && this.frm.doc.price_list_name) { - this.price_list_name(callback1); + if(this.frm.doc.__islocal) { + if (this.frm.fields_dict.price_list_name && this.frm.doc.price_list_name) { + this.price_list_name(callback1); + } else { + callback1(doc, dt, dn); + } } } diff --git a/buying/doctype/supplier_quotation/supplier_quotation.js b/buying/doctype/supplier_quotation/supplier_quotation.js index 36f9be8dc8..1e4f6cbfb7 100644 --- a/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/buying/doctype/supplier_quotation/supplier_quotation.js @@ -40,9 +40,12 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext } // TODO: improve this - if(this.frm.doc.__islocal && this.frm.fields_dict.price_list_name - && this.frm.doc.price_list_name) { - this.price_list_name(callback); + if(this.frm.doc.__islocal) { + if (this.frm.fields_dict.price_list_name && this.frm.doc.price_list_name) { + this.price_list_name(callback); + } else { + callback(doc, dt, dn); + } } } diff --git a/stock/doctype/purchase_receipt/purchase_receipt.js b/stock/doctype/purchase_receipt/purchase_receipt.js index c7d2e504f5..82e494cfb7 100644 --- a/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/stock/doctype/purchase_receipt/purchase_receipt.js @@ -45,9 +45,11 @@ erpnext.buying.PurchaseReceiptController = erpnext.buying.BuyingController.exten } // TODO: improve this - if(this.frm.doc.__islocal && this.frm.fields_dict.price_list_name - && this.frm.doc.price_list_name) { - this.price_list_name(callback); + if(this.frm.doc.__islocal) { + if (this.frm.fields_dict.price_list_name && this.frm.doc.price_list_name) + this.price_list_name(callback); + else + callback(doc, dt, dn); } } });