Merge pull request #4401 from nabinhait/pr-for-non-stock-items

[fix] Show 'Make Purchase Receipt' button in PO even if all items are non-stock items
This commit is contained in:
Rushabh Mehta 2015-11-30 16:56:28 +05:30
commit e7bb6544f5
2 changed files with 1 additions and 4 deletions

View File

@ -60,7 +60,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
}
if(doc.docstatus == 1 && !in_list(["Stopped", "Closed"], doc.status)) {
if(flt(doc.per_received, 2) < 100 && this.frm.doc.__onload.has_stock_item && allow_receipt) {
if(flt(doc.per_received, 2) < 100 && allow_receipt) {
cur_frm.add_custom_button(__('Receive'), this.make_purchase_receipt).addClass("btn-primary");
if(doc.is_subcontracted==="Yes") {

View File

@ -33,9 +33,6 @@ class PurchaseOrder(BuyingController):
'overflow_type': 'order'
}]
def onload(self):
self.set_onload("has_stock_item", len(self.get_stock_items()) > 0)
def validate(self):
super(PurchaseOrder, self).validate()