[translations] fixes #4533

This commit is contained in:
Rushabh Mehta 2016-01-04 15:57:01 +05:30
parent eb961370ff
commit 5760b79747
7 changed files with 18 additions and 16 deletions

View File

@ -90,12 +90,12 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
var frm = cur_frm;
if(frm.perm[0].write && doc.docstatus==0) {
if(frm.doc.status==="Open") {
frm.add_custom_button("Close", function() {
frm.add_custom_button(__("Close"), function() {
frm.set_value("status", "Closed");
frm.save();
});
} else {
frm.add_custom_button("Reopen", function() {
frm.add_custom_button(__("Reopen"), function() {
frm.set_value("status", "Open");
frm.save();
});

View File

@ -31,12 +31,12 @@ frappe.ui.form.on("Task", {
if(frm.perm[0].write) {
if(frm.doc.status!=="Closed" && frm.doc.status!=="Cancelled") {
frm.add_custom_button("Close", function() {
frm.add_custom_button(__("Close"), function() {
frm.set_value("status", "Closed");
frm.save();
});
} else {
frm.add_custom_button("Reopen", function() {
frm.add_custom_button(__("Reopen"), function() {
frm.set_value("status", "Open");
frm.save();
});

View File

@ -180,6 +180,6 @@ erpnext.SalesFunnel = Class.extend({
context.fillStyle = "black";
context.textBaseline = "middle";
context.font = "1.1em sans-serif";
context.fillText(title, width + 20, y_mid);
context.fillText(__(title), width + 20, y_mid);
}
});

View File

@ -4,6 +4,8 @@
from __future__ import unicode_literals
import frappe
from frappe import _
@frappe.whitelist()
def get_funnel_data(from_date, to_date):
active_leads = frappe.db.sql("""select count(*) from `tabLead`
@ -26,8 +28,8 @@ def get_funnel_data(from_date, to_date):
where docstatus = 1 and (date(`creation`) between %s and %s)""", (from_date, to_date))[0][0]
return [
{ "title": "Active Leads / Customers", "value": active_leads, "color": "#B03B46" },
{ "title": "Opportunities", "value": opportunities, "color": "#F09C00" },
{ "title": "Quotations", "value": quotations, "color": "#006685" },
{ "title": "Sales Orders", "value": sales_orders, "color": "#00AD65" }
{ "title": _("Active Leads / Customers"), "value": active_leads, "color": "#B03B46" },
{ "title": _("Opportunities"), "value": opportunities, "color": "#F09C00" },
{ "title": _("Quotations"), "value": quotations, "color": "#006685" },
{ "title": _("Sales Orders"), "value": sales_orders, "color": "#00AD65" }
]

View File

@ -46,13 +46,13 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
this.show_general_ledger();
}
if (this.frm.has_perm("submit") && (doc.status !== "Closed")
if (this.frm.has_perm("submit") && (doc.status !== "Closed")
&& this.frm.doc.__onload && this.frm.doc.__onload.has_return_entry) {
cur_frm.add_custom_button(__("Close"), this.close_delivery_note)
}
}
if(doc.__onload && !doc.__onload.billing_complete && doc.docstatus==1
if(doc.__onload && !doc.__onload.billing_complete && doc.docstatus==1
&& !doc.is_return && doc.status!="Closed") {
// show Make Invoice button only if Delivery Note is not created from Sales Invoice
var from_sales_invoice = false;
@ -65,7 +65,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
}
if(doc.docstatus==1 && doc.status === "Closed" && this.frm.has_perm("submit")) {
cur_frm.add_custom_button(__('Re-open'), this.reopen_delivery_note)
cur_frm.add_custom_button(__('Reopen'), this.reopen_delivery_note)
}
erpnext.stock.delivery_note.set_print_hide(doc, dt, dn);

View File

@ -60,7 +60,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
cur_frm.add_custom_button(__('Invoice'),
this.make_purchase_invoice).addClass("btn-primary");
}
if (this.frm.has_perm("submit") &&
if (this.frm.has_perm("submit") &&
this.frm.doc.__onload && this.frm.doc.__onload.has_return_entry) {
cur_frm.add_custom_button(__("Close"), this.close_purchase_receipt)
}
@ -69,7 +69,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
if(this.frm.doc.docstatus==1 && this.frm.doc.status === "Closed" && this.frm.has_perm("submit")) {
cur_frm.add_custom_button(__('Re-open'), this.reopen_purchase_receipt)
cur_frm.add_custom_button(__('Reopen'), this.reopen_purchase_receipt)
}
this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_subcontracted==="Yes");

View File

@ -5,12 +5,12 @@ frappe.ui.form.on("Issue", {
"refresh": function(frm) {
if(frm.doc.status==="Open") {
frm.add_custom_button("Close", function() {
frm.add_custom_button(__("Close"), function() {
frm.set_value("status", "Closed");
frm.save();
});
} else {
frm.add_custom_button("Reopen", function() {
frm.add_custom_button(__("Reopen"), function() {
frm.set_value("status", "Open");
frm.save();
});