[fixes] reload doc after status update and supplier address fetching
This commit is contained in:
parent
653cffec1e
commit
2e65aadb1e
@ -179,7 +179,9 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
|||||||
purchase_order: cur_frm.doc.name
|
purchase_order: cur_frm.doc.name
|
||||||
},
|
},
|
||||||
callback:function(r){
|
callback:function(r){
|
||||||
cur_frm.refresh();
|
if(!r.exc) {
|
||||||
|
cur_frm.reload_doc();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -198,7 +200,8 @@ cur_frm.cscript.update_status= function(label, status){
|
|||||||
method: "erpnext.buying.doctype.purchase_order.purchase_order.update_status",
|
method: "erpnext.buying.doctype.purchase_order.purchase_order.update_status",
|
||||||
args:{status: status, name: doc.name},
|
args:{status: status, name: doc.name},
|
||||||
callback:function(r){
|
callback:function(r){
|
||||||
cur_frm.refresh();
|
cur_frm.set_value("status", status);
|
||||||
|
cur_frm.reload_doc();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -344,14 +344,12 @@ def make_stock_entry(purchase_order, item_code):
|
|||||||
def update_status(status, name):
|
def update_status(status, name):
|
||||||
po = frappe.get_doc("Purchase Order", name)
|
po = frappe.get_doc("Purchase Order", name)
|
||||||
po.update_status(status)
|
po.update_status(status)
|
||||||
return
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def delivered_by_supplier(purchase_order):
|
def delivered_by_supplier(purchase_order):
|
||||||
po = frappe.get_doc("Purchase Order", purchase_order)
|
po = frappe.get_doc("Purchase Order", purchase_order)
|
||||||
update_delivered_qty(po)
|
update_delivered_qty(po)
|
||||||
po.update_status("Delivered")
|
po.update_status("Delivered")
|
||||||
return po.as_dict()
|
|
||||||
|
|
||||||
def update_delivered_qty(purchase_order):
|
def update_delivered_qty(purchase_order):
|
||||||
sales_order_list = []
|
sales_order_list = []
|
||||||
|
@ -53,7 +53,7 @@ erpnext.utils.get_address_display = function(frm, address_field, display_field)
|
|||||||
if(frm.updating_party_details) return;
|
if(frm.updating_party_details) return;
|
||||||
|
|
||||||
if(!address_field) {
|
if(!address_field) {
|
||||||
if(frm.doc.customer) {
|
if(frm.doctype != "Purchase Order" && frm.doc.customer) {
|
||||||
address_field = "customer_address";
|
address_field = "customer_address";
|
||||||
} else if(frm.doc.supplier) {
|
} else if(frm.doc.supplier) {
|
||||||
address_field = "supplier_address";
|
address_field = "supplier_address";
|
||||||
|
@ -37,7 +37,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
|||||||
// doc.per_billed);
|
// doc.per_billed);
|
||||||
|
|
||||||
// indent
|
// indent
|
||||||
if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1)
|
if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && flt(doc.per_delivered, 2) < 100)
|
||||||
cur_frm.add_custom_button(__('Material Request'), this.make_material_request);
|
cur_frm.add_custom_button(__('Material Request'), this.make_material_request);
|
||||||
|
|
||||||
if(flt(doc.per_billed)==0) {
|
if(flt(doc.per_billed)==0) {
|
||||||
@ -241,7 +241,7 @@ cur_frm.cscript.update_status = function(label, status){
|
|||||||
method: "erpnext.selling.doctype.sales_order.sales_order.update_status",
|
method: "erpnext.selling.doctype.sales_order.sales_order.update_status",
|
||||||
args:{status: status, name: doc.name},
|
args:{status: status, name: doc.name},
|
||||||
callback:function(r){
|
callback:function(r){
|
||||||
cur_frm.refresh();
|
cur_frm.reload_doc();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user