Merge branch 'develop'

This commit is contained in:
Pratik Vyas 2015-05-26 17:06:39 +05:30
commit dcbc4d1a46
36 changed files with 354 additions and 228 deletions

View File

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '5.0.9'
__version__ = '5.0.10'

View File

@ -76,9 +76,9 @@ class JournalEntry(AccountsController):
account_type = frappe.db.get_value("Account", d.account, "account_type")
if account_type in ["Receivable", "Payable"]:
if not (d.party_type and d.party):
frappe.throw(_("Row{0}: Party Type and Party is required for Receivable / Payable account {1}").format(d.idx, d.account))
frappe.throw(_("Row {0}: Party Type and Party is required for Receivable / Payable account {1}").format(d.idx, d.account))
elif d.party_type and d.party:
frappe.throw(_("Row{0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
frappe.throw(_("Row {0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
def check_credit_limit(self):
customers = list(set([d.party for d in self.get("accounts") if d.party_type=="Customer" and flt(d.debit) > 0]))
@ -438,7 +438,7 @@ class JournalEntry(AccountsController):
if self.stock_entry:
if frappe.db.get_value("Stock Entry", self.stock_entry, "docstatus") != 1:
frappe.throw(_("Stock Entry {0} is not submitted").format(self.stock_entry))
if frappe.db.exists({"doctype": "Journal Entry", "stock_entry": self.stock_entry, "docstatus":1}):
frappe.msgprint(_("Warning: Another {0} # {1} exists against stock entry {2}".format(self.voucher_type, self.name, self.stock_entry)))

View File

@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe import _
from frappe.utils import flt
def execute(filters=None):
@ -23,7 +23,7 @@ def execute(filters=None):
purchase_receipt = d.purchase_receipt
elif d.po_detail:
purchase_receipt = ", ".join(frappe.db.sql_list("""select distinct parent
from `tabPurchase Receipt Item` where docstatus=1 and po_detail=%s""", d.po_detail))
from `tabPurchase Receipt Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail))
expense_account = d.expense_account or aii_account_map.get(d.company)
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,

View File

@ -144,7 +144,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
return invoice_expense_map, invoice_tax_map
def get_invoice_po_pr_map(invoice_list):
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail,
project_name from `tabPurchase Invoice Item` where parent in (%s)
and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')""" %
', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
@ -160,7 +160,7 @@ def get_invoice_po_pr_map(invoice_list):
pr_list = [d.purchase_receipt]
elif d.po_detail:
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
where docstatus=1 and po_detail=%s""", d.pr_detail)
where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail)
if pr_list:
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)

View File

@ -55,6 +55,14 @@ def get_data():
"name": "BOM Replace Tool",
"description": _("Replace Item / BOM in all BOMs"),
},
{
"type": "page",
"name": "bom-browser",
"icon": "icon-sitemap",
"label": _("BOM Browser"),
"description": _("Tree of Bill of Materials"),
"doctype": "BOM"
}
]
},
{

View File

@ -8,7 +8,9 @@ import frappe.utils
from frappe import throw, _
from frappe.model.document import Document
from frappe.email.bulk import check_bulk_limit
from frappe.utils.verified_command import get_signed_params, verify_request
import erpnext.tasks
from erpnext.crm.doctype.newsletter_list.newsletter_list import add_subscribers
class Newsletter(Document):
def onload(self):
@ -87,7 +89,6 @@ def get_lead_options():
@frappe.whitelist(allow_guest=True)
def unsubscribe(email, name):
from frappe.utils.verified_command import verify_request
if not verify_request():
return
@ -123,3 +124,47 @@ def create_lead(email_id):
"source": "Email"
})
lead.insert()
@frappe.whitelist(allow_guest=True)
def subscribe(email):
url = frappe.utils.get_url("/api/method/erpnext.crm.doctype.newsletter.newsletter.confirm_subscription") +\
"?" + get_signed_params({"email": email})
messages = (
_("Thank you for your interest in subscribing to our updates"),
_("Please verify your email id"),
url,
_("Click here to verify")
)
print url
content = """
<p>{0}. {1}.</p>
<p><a href="{2}">{3}</a></p>
"""
frappe.sendmail(email, subject=_("Confirm Your Email"), content=content.format(*messages), bulk=True)
@frappe.whitelist(allow_guest=True)
def confirm_subscription(email):
if not verify_request():
return
if not frappe.db.exists("Newsletter List", _("Website")):
frappe.get_doc({
"doctype": "Newsletter List",
"title": _("Website")
}).insert(ignore_permissions=True)
frappe.flags.ignore_permissions = True
add_subscribers(_("Website"), email)
frappe.db.commit()
frappe.respond_as_web_page(_("Confirmed"), _("{0} has been successfully added to our Newsletter list.").format(email))

View File

@ -5,7 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import validate_email_add, strip
from frappe.utils import validate_email_add
from frappe import _
from email.utils import parseaddr
@ -75,7 +75,7 @@ def add_subscribers(name, email_list):
"doctype": "Newsletter List Subscriber",
"newsletter_list": name,
"email": email
}).insert()
}).insert(ignore_permissions = frappe.flags.ignore_permissions)
count += 1
else:

View File

@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "5.0.9"
app_version = "5.0.10"
error_report_email = "support@erpnext.com"
@ -96,8 +96,8 @@ scheduler_events = {
]
}
default_mail_footer = """<div style="padding: 7px; margin-top: 7px;">
<a style="color: #8D99A6; font-size: 85%; text-decoration: none;" href="https://erpnext.com" target="_blank">
default_mail_footer = """<div style="padding: 15px; text-align: center;">
<a href="https://erpnext.com?source=via_email_footer" target="_blank" style="color: #8d99a6;">
Sent via ERPNext
</a>
</div>"""

View File

@ -1,27 +1,36 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
// On REFRESH
frappe.provide("erpnext.bom");
cur_frm.cscript.refresh = function(doc,dt,dn){
cur_frm.toggle_enable("item", doc.__islocal);
toggle_operations(cur_frm);
if (!doc.__islocal && doc.docstatus<2) {
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost);
}
}
frappe.ui.form.on("BOM", {
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
},
refresh: function(frm) {
frm.toggle_enable("item", frm.doc.__islocal);
toggle_operations(frm);
cur_frm.cscript.update_cost = function() {
return frappe.call({
doc: cur_frm.doc,
method: "update_cost",
freeze: true,
callback: function(r) {
if(!r.exc) cur_frm.refresh_fields();
if (!frm.doc.__islocal && frm.doc.docstatus<2) {
frm.add_custom_button(__("Update Cost"), function() {
frm.events.update_cost(frm);
});
frm.add_custom_button(__("Browse BOM"), function() {
frappe.set_route("bom-browser", frm.doc.name);
});
}
})
}
},
update_cost: function(frm) {
return frappe.call({
doc: frm.doc,
method: "update_cost",
freeze: true,
callback: function(r) {
if(!r.exc) frm.refresh_fields();
}
})
}
});
cur_frm.add_fetch("item", "description", "description");
cur_frm.add_fetch("item", "image", "image");

View File

View File

@ -0,0 +1,90 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.pages['bom-browser'].on_page_load = function(wrapper) {
var page = frappe.ui.make_app_page({
parent: wrapper,
title: 'BOM Browser',
single_column: true
});
page.main.css({
"min-height": "300px",
"padding-bottom": "25px"
});
page.tree_area = $('<div class="padding"><p class="text-muted">'+
__("Select BOM to start")
+'</p></div>').appendTo(page.main);
frappe.breadcrumbs.add(frappe.breadcrumbs.last_module || "Manufacturing");
var make_tree = function() {
erpnext.bom_tree = new erpnext.BOMTree(page.$bom_select.val(), page, page.tree_area);
}
page.$bom_select = wrapper.page.add_field({fieldname: "bom",
fieldtype:"Link", options: "BOM", label: __("BOM")}).$input
.change(function() {
make_tree();
});
page.set_secondary_action(__('Refresh'), function() {
make_tree();
});
}
frappe.pages['bom-browser'].on_page_show = function(wrapper){
// set from route
var bom = null;
if(frappe.get_route()[1]) {
var bom = frappe.get_route().splice(1).join("/");
}
if(frappe.route_options && frappe.route_options.bom) {
var bom = frappe.route_options.bom;
}
if(bom) {
wrapper.page.$bom_select.val(bom).trigger("change");
}
};
erpnext.BOMTree = Class.extend({
init: function(root, page, parent) {
$(parent).empty();
var me = this;
me.page = page;
me.bom = page.$bom_select.val();
me.can_read = frappe.model.can_read("BOM");
me.can_create = frappe.boot.user.can_create.indexOf("BOM") !== -1 ||
frappe.boot.user.in_create.indexOf("BOM") !== -1;
me.can_write = frappe.model.can_write("BOM");
me.can_delete = frappe.model.can_delete("BOM");
this.tree = new frappe.ui.Tree({
parent: $(parent),
label: me.bom,
args: {parent: me.bom},
method: 'erpnext.manufacturing.page.bom_browser.bom_browser.get_children',
toolbar: [
{toggle_btn: true},
{
label:__("Edit"),
condition: function(node) {
return node.expandable;
},
click: function(node) {
frappe.set_route("Form", "BOM", node.data.parent);
}
}
],
get_label: function(node) {
if(node.data.qty) {
return node.data.qty + " x " + node.data.value;
} else {
return node.data.value;
}
}
});
}
});

View File

@ -0,0 +1,21 @@
{
"content": null,
"creation": "2015-05-25 02:57:33.472044",
"docstatus": 0,
"doctype": "Page",
"modified": "2015-05-25 02:57:33.472044",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "bom-browser",
"owner": "Administrator",
"page_name": "bom-browser",
"roles": [
{
"role": "Manufacturing User"
}
],
"script": null,
"standard": "Yes",
"style": null,
"title": "BOM Browser"
}

View File

@ -0,0 +1,15 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def get_children(parent):
return frappe.db.sql("""select item_code as value,
bom_no as parent, qty,
if(ifnull(bom_no, "")!="", 1, 0) as expandable
from `tabBOM Item`
where parent=%s
order by idx
""", parent, as_dict=True)

View File

@ -156,4 +156,5 @@ erpnext.patches.v5_0.repost_requested_qty
erpnext.patches.v5_0.fix_taxes_and_totals_in_party_currency
erpnext.patches.v5_0.update_tax_amount_after_discount_in_purchase_cycle
erpnext.patches.v5_0.rename_pos_setting
erpnext.patches.v5_0.update_operation_description
erpnext.patches.v5_0.update_operation_description
erpnext.patches.v5_0.set_footer_address

View File

@ -0,0 +1,7 @@
import frappe
def execute():
frappe.reload_doctype("System Settings")
ss = frappe.get_doc("System Settings", "System Settings")
ss.email_footer_address = frappe.db.get_default("company")
ss.save()

View File

@ -10,13 +10,15 @@ def execute():
for m in frappe.get_all("Project Milestone", "*"):
if (m.milestone and m.milestone_date
and frappe.db.exists("Project", m.parent)):
frappe.get_doc({
task = frappe.get_doc({
"doctype": "Task",
"subject": m.milestone,
"expected_start_date": m.milestone_date,
"status": "Open" if m.status=="Pending" else "Closed",
"project": m.parent,
}).insert(ignore_permissions=True)
})
task.flags.ignore_mandatory = True
task.insert(ignore_permissions=True)
# remove project milestone
frappe.delete_doc("DocType", "Project Milestone")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg2"
version="1.1"
viewBox="0 0 680 820"
preserveAspectRatio="xMidyMid meet"
width="100%"
height="100%">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
style="display:inline">
<rect
style="fill:#fff"
id="rect3800"
width="150"
height="150"
x="60.000008"
y="-472.36218"
rx="20"
ry="20"
transform="scale(1,-1)" />
</g>
<g
id="layer2">
<path
transform="scale(1,-1)"
style="display:inline;fill:#fff"
d="m 180,-372.36218 110,0 20,0 0,20 0,110 c 0,11.08 -8.92,20 -20,20 l -110,0 c -11.08,0 -20,-8.92 -20,-20 l 0,-110 c 0,-11.08 8.92,-20 20,-20 z"
id="rect3051"/>
</g>
<g
id="layer3">
<rect
style="display:inline;fill:#fff"
id="rect3840"
width="150"
height="150"
x="260"
y="-272.36218"
rx="20"
ry="20"
transform="scale(1,-1)" />
</g>
<g
id="layer4">
<path
id="path3054"
d="m 490,372.36218 -110,0 -20,0 0,-20 0,-110 c 0,-11.08 8.92,-20 20,-20 l 110,0 c 11.08,0 20,8.92 20,20 l 0,110 c 0,11.08 -8.92,20 -20,20 z"
style="display:inline;fill:#fff" />
</g>
<g
id="layer5">
<rect
style="display:inline;fill:#fff"
id="rect3844"
width="150"
height="150"
x="460"
y="-472.36218"
rx="20"
ry="20"
transform="scale(1,-1)" />
</g>
<g
id="layer6">
<path
style="display:inline;fill:#fff"
d="m 490,422.36218 -110,0 -20,0 0,20 0,110 c 0,11.08 8.92,20 20,20 l 110,0 c 11.08,0 20,-8.92 20,-20 l 0,-110 c 0,-11.08 -8.92,-20 -20,-20 z"
id="path3058" />
</g>
<g
id="layer7">
<rect
style="display:inline;fill:#fff"
id="rect3848"
width="150"
height="150"
x="260"
y="-672.36218"
rx="20"
ry="20"
transform="scale(1,-1)" />
</g>
<g
id="layer8">
<path
id="path3056"
d="m 180,422.36218 110,0 20,0 0,20 0,110 c 0,11.08 -8.92,20 -20,20 l -110,0 c -11.08,0 -20,-8.92 -20,-20 l 0,-110 c 0,-11.08 8.92,-20 20,-20 z"
style="display:inline;fill:#fff" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

View File

@ -98,7 +98,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
},
hide_currency_and_price_list: function() {
if(this.frm.doc.docstatus > 0) {
if(this.frm.doc.conversion_rate == 1 && this.frm.doc.docstatus > 0) {
hide_field("currency_and_price_list");
} else {
unhide_field("currency_and_price_list");

View File

@ -15,5 +15,15 @@ frappe.send_message = function(opts, btn) {
});
};
erpnext.subscribe_to_newsletter = function(opts, btn) {
return frappe.call({
type: "POST",
method: "erpnext.crm.doctype.newsletter.newsletter.subscribe",
btn: btn,
args: {"email": opts.email},
callback: opts.callback
});
}
// for backward compatibility
erpnext.send_message = frappe.send_message;
erpnext.send_message = frappe.send_message;

View File

@ -50,10 +50,14 @@ def get_conditions(filters, date_field):
conditions = [""]
values = []
for field in ["company", "customer", "territory", "sales_person"]:
for field in ["company", "customer", "territory"]:
if filters.get(field):
conditions.append("dt.{0}=%s".format(field))
values.append(filters[field])
if filters.get("sales_person"):
conditions.append("st.sales_person=%s")
values.append(filters["sales_person"])
if filters.get("from_date"):
conditions.append("dt.{0}>=%s".format(date_field))

View File

@ -11,31 +11,37 @@ frappe.ui.form.on("Company", {
erpnext.company.set_chart_of_accounts_options(frm.doc);
},
delete_company_transactions: function(frm) {
var d = frappe.prompt({
fieldtype:"Data",
fieldname: "company_name",
label: __("Please re-type company name to confirm"),
reqd: 1,
description: __("Please make sure you really want to delete all the transactions for this company. Your master data will remain as it is. This action cannot be undone.")},
function(data) {
if(data.company_name !== frm.doc.name) {
frappe.msgprint("Company name not same");
return;
}
frappe.call({
method: "erpnext.setup.doctype.company.delete_company_transactions.delete_company_transactions",
args: {
company_name: data.company_name
},
freeze: true,
callback: function(r, rt) {
if(!r.exc)
frappe.msgprint(__("Successfully deleted all transactions related to this company!"));
frappe.verify_password(function() {
var d = frappe.prompt({
fieldtype:"Data",
fieldname: "company_name",
label: __("Please re-type company name to confirm"),
reqd: 1,
description: __("Please make sure you really want to delete all the transactions for this company. Your master data will remain as it is. This action cannot be undone.")},
function(data) {
if(data.company_name !== frm.doc.name) {
frappe.msgprint("Company name not same");
return;
}
});
}, __("Delete all the Transactions for this Company"), __("Delete"));
d.get_primary_btn().addClass("btn-danger");
frappe.call({
method: "erpnext.setup.doctype.company.delete_company_transactions.delete_company_transactions",
args: {
company_name: data.company_name
},
freeze: true,
callback: function(r, rt) {
if(!r.exc)
frappe.msgprint(__("Successfully deleted all transactions related to this company!"));
},
onerror: function() {
frappe.msgprint(__("Wrong Password"));
}
});
}, __("Delete all the Transactions for this Company"), __("Delete")
);
d.get_primary_btn().addClass("btn-danger");
}
);
}
});

View File

@ -197,6 +197,7 @@ def set_defaults(args):
"language": args.get("language"),
"time_zone": args.get("timezone"),
"float_precision": 3,
"email_footer_address": args.get("company"),
'date_format': frappe.db.get_value("Country", args.get("country"), "date_format"),
'number_format': number_format,
'enable_scheduler': 1 if not frappe.flags.in_test else 0

View File

@ -575,6 +575,7 @@
"description": "Publish Item to hub.erpnext.com",
"fieldname": "publish_in_hub",
"fieldtype": "Check",
"hidden": 1,
"label": "Publish in Hub",
"permlevel": 0,
"precision": ""
@ -878,7 +879,7 @@
"icon": "icon-tag",
"idx": 1,
"max_attachments": 1,
"modified": "2015-05-04 18:44:46.090445",
"modified": "2015-05-22 02:16:57.435105",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",

View File

@ -1,15 +1,18 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
$.extend(cur_frm.cscript, {
onload: function () {
frappe.ui.form.on("Item Price", {
onload: function (frm) {
// Fetch price list details
cur_frm.add_fetch("price_list", "buying", "buying");
cur_frm.add_fetch("price_list", "selling", "selling");
cur_frm.add_fetch("price_list", "currency", "currency");
frm.add_fetch("price_list", "buying", "buying");
frm.add_fetch("price_list", "selling", "selling");
frm.add_fetch("price_list", "currency", "currency");
// Fetch item details
cur_frm.add_fetch("item_code", "item_name", "item_name");
cur_frm.add_fetch("item_code", "description", "item_description");
frm.add_fetch("item_code", "item_name", "item_name");
frm.add_fetch("item_code", "description", "item_description");
frm.set_df_property("bulk_import_help", "options",
'<a href="#data-import-tool/Item Price">' + __("Import in Bulk") + '</a>');
}
});
});

View File

@ -100,13 +100,26 @@
"label": "Item Description",
"permlevel": 0,
"read_only": 1
},
{
"fieldname": "section_break_12",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "bulk_import_help",
"fieldtype": "HTML",
"label": "Bulk Import Help",
"permlevel": 0,
"precision": ""
}
],
"icon": "icon-flag",
"idx": 1,
"in_create": 0,
"istable": 0,
"modified": "2015-03-03 01:05:09.876025",
"modified": "2015-05-26 03:15:02.324161",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Price",

View File

@ -0,0 +1,42 @@
{% if not hide_footer_signup %}
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3 text-center" style="margin-top: 15px;">
<input class="form-control" type="text" id="footer-subscribe-email"
style="display: inline-block; max-width: 50%; margin-right: 10px;"
placeholder="{{ _('Your email address') }}...">
<button class="btn btn-default btn-sm" type="button"
id="footer-subscribe-button">{{ _("Get Updates") }}</button>
</div>
</div>
<div class="text-center text-muted small" style="padding: 30px;">
<a href="https://erpnext.com?source=website_footer" target="_blank" class="text-extra-muted">
Powered by ERPNext</a>
</div>
</div>
<script>
$("#footer-subscribe-button").click(function() {
if($("#footer-subscribe-email").val()) {
$("#footer-subscribe-email").attr('disabled', true);
$("#footer-subscribe-button").html("Sending...")
.attr("disabled", true);
erpnext.subscribe_to_newsletter({
email: $("#footer-subscribe-email").val(),
callback: function(r) {
if(!r.exc) {
$("#footer-subscribe-button").html(__("Added"))
.attr("disabled", true);
} else {
$("#footer-subscribe-button").html(__("Error: Not a valid id?"))
.addClass("btn-danger").attr("disabled", false);
$("#footer-subscribe-email").val("").attr('disabled', false);
}
}
});
}
else
frappe.msgprint(frappe._("Please enter email address"))
});
</script>
{% endif %}

View File

@ -0,0 +1 @@
<!-- blank -->

View File

@ -1,41 +0,0 @@
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3" style="margin-top: 7px;">
<div class="input-group">
<input class="form-control" type="text" id="footer-subscribe-email"
placeholder="{{ _('Your email address') }}...">
<span class="input-group-btn">
<button class="btn btn-default" type="button"
id="footer-subscribe-button">{{ _("Stay Updated") }}</button>
</span>
</div>
</div>
</div>
</div>
<script>
$("#footer-subscribe-button").click(function() {
if($("#footer-subscribe-email").val()) {
$("#footer-subscribe-email").attr('disabled', true);
$("#footer-subscribe-button").html("Sending...")
.attr("disabled", true);
erpnext.send_message({
subject:"Subscribe me",
sender: $("#footer-subscribe-email").val(),
message: "Subscribe to newsletter (via website footer).",
callback: function(r) {
if(!r.exc) {
$("#footer-subscribe-button").html("Thank You :)")
.addClass("btn-success").attr("disabled", true);
} else {
$("#footer-subscribe-button").html("Error :( Not a valid id?")
.addClass("btn-danger").attr("disabled", false);
$("#footer-subscribe-email").val("").attr('disabled', false);
}
}
});
}
else
frappe.msgprint(frappe._("Please enter email address"))
});
</script>

View File

@ -1 +0,0 @@
<a href="http://erpnext.com" style="color: #aaa; font-size: 11px;">ERPNext Powered</a>

View File

@ -4,11 +4,12 @@
</div>
{%- endif %}
<div>
{% if doc.in_format_data("item_code") -%}
{% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%}
<div class="primary">{{ doc.item_code }}</div>
{%- endif %}
{% if (doc.in_format_data("item_name") and
(not doc.in_format_data("item_code") or doc.item_code != doc.item_name)) -%}
(not doc.in_format_data("item_code") or doc.is_print_hide("item_code")
or doc.item_code != doc.item_name)) -%}
<div class="primary">{{ doc.get_formatted("item_name") }}</div>
{%- endif %}
{% if (doc.in_format_data("description") and doc.description and

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages
version = "5.0.9"
version = "5.0.10"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()