[Minor Fixes] Findings in setting up erpnext

This commit is contained in:
Kanchan Chauhan 2016-04-06 19:28:50 +05:30
parent 5ea0799f83
commit 017d30f465
5 changed files with 7 additions and 25 deletions

View File

@ -61,7 +61,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
}
}
if(doc.docstatus == 1 && doc.status != "Closed") {
if(doc.docstatus == 1 && !in_list(["Closed", "Completed"], doc.status)) {
if(flt(doc.per_received, 2) < 100 && allow_receipt) {
cur_frm.add_custom_button(__('Receive'), this.make_purchase_receipt, __("Make"));

View File

@ -103,10 +103,7 @@ class PurchaseOrder(BuyingController):
d.price_list_rate = d.base_price_list_rate / conversion_rate
d.rate = d.base_rate / conversion_rate
else:
# if no last purchase found, reset all values to 0
for field in ("base_price_list_rate", "base_rate",
"price_list_rate", "rate", "discount_percentage"):
d.set(field, 0)
msgprint(_("Last purchase rate not found"))
item_last_purchase_rate = frappe.db.get_value("Item", d.item_code, "last_purchase_rate")
if item_last_purchase_rate:

View File

@ -18,6 +18,10 @@ cur_frm.add_fetch("sales_order", "customer", "customer");
cur_frm.add_fetch("sales_order", "base_grand_total", "grand_total");
frappe.ui.form.on("Production Planning Tool", {
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "planned_qty");
},
get_sales_orders: function(frm) {
frappe.call({
doc: frm.doc,

View File

@ -126,7 +126,7 @@ class Project(Document):
self.total_purchase_cost = total_purchase_cost and total_purchase_cost[0][0] or 0
def send_welcome_email(self):
url = get_url("/project/{0}".format(self.name))
url = get_url("/project/?name={0}".format(self.name))
messages = (
_("You have been invited to collaborate on the project: {0}".format(self.name)),
url,
@ -140,7 +140,6 @@ class Project(Document):
for user in self.users:
if user.welcome_email_sent==0:
print user.welcome_email_sent
frappe.sendmail(user.user, subject=_("Project Collaboration Invitation"), content=content.format(*messages), bulk=True)
user.welcome_email_sent=1

View File

@ -19,23 +19,6 @@ frappe.ready(function() {
}
})
//
// $('.btn-closed-tasks').click(function() {
// reload_items('closed','tasks');
// });
//
// $('.btn-open-tasks').click(function() {
// reload_items('open','tasks');
// });
//
// $('.btn-closed-issues').click(function() {
// reload_items('closed','issues');
// });
//
// $('.btn-open-issues').click(function() {
// reload_items('open','issues');
// });
var start = 10;
$(".more-tasks").click(function() {
more_items('task', true);
@ -66,7 +49,6 @@ frappe.ready(function() {
},
dataType: "json",
success: function(data) {
console.log(data.message);
if(typeof data.message == 'undefined') {
$('.project-'+ item).html("No "+ item_status +" "+ item);
$(".more-"+ item).toggle(false);