Merge branch 'develop'
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index 9c5fffa..aad7276 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
from __future__ import unicode_literals
-__version__ = '6.11.0'
+__version__ = '6.11.1'
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
index cd9d9d0..9ffed71 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
@@ -2,10 +2,29 @@
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Bank Reconciliation", {
+ setup: function(frm) {
+ frm.get_docfield("journal_entries").allow_bulk_edit = 1;
+ frm.add_fetch("bank_account", "company", "company");
+ },
+
+ onload: function(frm) {
+ frm.set_query("bank_account", function() {
+ return {
+ "filters": {
+ "account_type": "Bank",
+ "is_group": 0
+ }
+ };
+ });
+
+ frm.set_value("from_date", frappe.datetime.month_start());
+ frm.set_value("to_date", frappe.datetime.month_end());
+ },
+
refresh: function(frm) {
frm.disable_save();
},
-
+
update_clearance_date: function(frm) {
return frappe.call({
method: "update_details",
@@ -22,19 +41,3 @@
});
}
});
-
-cur_frm.cscript.onload = function(doc, cdt, cdn) {
- cur_frm.add_fetch("bank_account", "company", "company");
-
- cur_frm.set_query("bank_account", function() {
- return {
- "filters": {
- "account_type": "Bank",
- "is_group": 0
- }
- };
- });
-
- cur_frm.set_value("from_date", frappe.datetime.month_start());
- cur_frm.set_value("to_date", frappe.datetime.month_end());
-}
\ No newline at end of file
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 2f0c0e5..d1e2cdc 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -35,7 +35,7 @@
party = out[party_type.lower()]
if not ignore_permissions and not frappe.has_permission(party_type, "read", party):
- frappe.throw(_("Not permitted"), frappe.PermissionError)
+ frappe.throw(_("Not permitted for {0}").format(party), frappe.PermissionError)
party = frappe.get_doc(party_type, party)
diff --git a/erpnext/change_log/v6/v6_11_1.md b/erpnext/change_log/v6/v6_11_1.md
new file mode 100644
index 0000000..7b10dcf
--- /dev/null
+++ b/erpnext/change_log/v6/v6_11_1.md
@@ -0,0 +1 @@
+- Update Clearance date via Upload and Download like Stock Reconciliation. Sponsored by [AG Techologies, Singapore](http://agtech.com.sg)
diff --git a/erpnext/config/stock.py b/erpnext/config/stock.py
index a4a7202..9b47e58 100644
--- a/erpnext/config/stock.py
+++ b/erpnext/config/stock.py
@@ -77,11 +77,6 @@
"type": "doctype",
"name": "Landed Cost Voucher",
"description": _("Update additional costs to calculate landed cost of items"),
- },
- {
- "type": "doctype",
- "name": "Stock UOM Replace Utility",
- "description": _("Change UOM for an Item."),
}
]
},
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index b6b7456..d8d2b34 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -7,7 +7,7 @@
app_description = """ERP made simple"""
app_icon = "icon-th"
app_color = "#e74c3c"
-app_version = "6.11.0"
+app_version = "6.11.1"
app_email = "info@erpnext.com"
app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext"
@@ -64,7 +64,7 @@
{"from_route": "/shipments", "to_route": "Delivery Note"},
{"from_route": "/shipments/<path:name>", "to_route": "order",
"defaults": {
- "doctype": "Delivery Notes",
+ "doctype": "Delivery Note",
"parents": [{"title": _("Shipments"), "name": "shipments"}]
}
}
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 89bf7c4..37c69a5 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -236,3 +236,4 @@
erpnext.patches.v6_8.move_drop_ship_to_po_items
erpnext.patches.v6_10.fix_ordered_received_billed
erpnext.patches.v6_10.fix_jv_total_amount
+erpnext.patches.v6_10.email_digest_default_quote
diff --git a/erpnext/patches/v6_10/email_digest_default_quote.py b/erpnext/patches/v6_10/email_digest_default_quote.py
new file mode 100644
index 0000000..003b317
--- /dev/null
+++ b/erpnext/patches/v6_10/email_digest_default_quote.py
@@ -0,0 +1,5 @@
+import frappe
+
+def execute():
+ frappe.reload_doctype("Email Digest")
+ frappe.db.sql("update `tabEmail Digest` set add_quote = 1")
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 87cc2f6..49f47e0 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -76,7 +76,7 @@
if(this.frm.doc.__islocal && !(this.frm.doc.taxes || []).length
&& !(this.frm.doc.__onload ? this.frm.doc.__onload.load_after_mapping : false)) {
this.apply_default_taxes();
- } else if(this.frm.doc.__islocal && this.frm.doc.company && this.frm.doc["items"]
+ } else if(this.frm.doc.__islocal && this.frm.doc.company && this.frm.doc["items"]
&& !this.frm.doc.is_pos) {
me.calculate_taxes_and_totals();
}
@@ -507,7 +507,7 @@
}
if(this.frm.fields_dict["advances"]) {
- setup_field_label_map(["advance_amount", "allocated_amount"],
+ setup_field_label_map(["advance_amount", "allocated_amount"],
this.frm.doc.party_account_currency, "advances");
}
@@ -558,9 +558,15 @@
apply_pricing_rule: function(item, calculate_taxes_and_totals) {
var me = this;
+ var args = this._get_args(item);
+ if (!(args.item_list && args.item_list.length)) {
+ if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
+ return;
+ }
+
return this.frm.call({
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule",
- args: { args: this._get_args(item) },
+ args: { args: args },
callback: function(r) {
if (!r.exc && r.message) {
me._set_values_for_item_list(r.message);
@@ -648,6 +654,9 @@
apply_price_list: function(item) {
var me = this;
var args = this._get_args(item);
+ if (!((args.item_list && args.item_list.length) || args.price_list)) {
+ return;
+ }
return this.frm.call({
method: "erpnext.stock.get_item_details.apply_price_list",
diff --git a/erpnext/setup/doctype/email_digest/email_digest.json b/erpnext/setup/doctype/email_digest/email_digest.json
index c47ebae..21371f1 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.json
+++ b/erpnext/setup/doctype/email_digest/email_digest.json
@@ -25,6 +25,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -46,6 +47,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -68,6 +70,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -91,6 +94,7 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -114,6 +118,7 @@
"options": "Daily\nWeekly\nMonthly",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -137,6 +142,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -158,6 +164,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -181,6 +188,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -203,6 +211,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -225,6 +234,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -247,6 +257,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -270,6 +281,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -293,6 +305,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -316,6 +329,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -338,6 +352,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -361,6 +376,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -384,6 +400,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -407,6 +424,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -430,6 +448,55 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "other",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Other",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "add_quote",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Add Quote",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -448,7 +515,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:46.135437",
+ "menu_index": 0,
+ "modified": "2015-11-27 01:48:34.725037",
"modified_by": "Administrator",
"module": "Setup",
"name": "Email Digest",
diff --git a/erpnext/setup/doctype/email_digest/templates/default.html b/erpnext/setup/doctype/email_digest/templates/default.html
index a931fbb..44c0490 100644
--- a/erpnext/setup/doctype/email_digest/templates/default.html
+++ b/erpnext/setup/doctype/email_digest/templates/default.html
@@ -115,9 +115,11 @@
{% endif %}
+{% if add_quote %}
<div style="text-align: center; margin: 50px; line-height: 1.5">
{{ quote.text }}<br><i>- {{ quote.author }}</i>
<br>
</div>
+{% endif %}
</div>
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index 5b8dd04..e44a53f 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -72,21 +72,20 @@
key = "currency_exchange_rate:{0}:{1}".format(from_currency, to_currency)
value = cache.get(key)
- print value
-
if not value:
import requests
response = requests.get("http://api.fixer.io/latest", params={
"base": from_currency,
"symbols": to_currency
})
- # expire in 24 hours
+ # expire in 6 hours
response.raise_for_status()
value = response.json()["rates"][to_currency]
- cache.setex(key, value, 24 * 60 * 60)
+ cache.setex(key, value, 6 * 60 * 60)
+
return flt(value)
except:
- frappe.msgprint(_("Unable to find exchange rate"))
+ frappe.msgprint(_("Unable to find exchange rate for {0} to {1}").format(from_currency, to_currency))
return 0.0
else:
return value
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 1cbb33d..b11603e 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -662,7 +662,5 @@
frappe.db.sql("""update tabBin set stock_uom=%s where item_code=%s""", (stock_uom, item))
if not matched:
- frappe.throw(_("Default Unit of Measure for Item {0} cannot be changed directly because \
- you have already made some transaction(s) with another UOM. To change default UOM, \
- use 'UOM Replace Utility' tool under Stock module.").format(item))
+ frappe.throw(_("Default Unit of Measure for Item {0} cannot be changed directly because you have already made some transaction(s) with another UOM. You will need to create a new Item to use a different Default UOM.").format(item))
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 6c6f84b..71bc64a 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -69,7 +69,7 @@
if args.get("is_subcontracted") == "Yes":
out.bom = get_default_bom(args.item_code)
-
+
return out
def process_args(args):
@@ -427,6 +427,9 @@
return result.currency
def get_price_list_currency_and_exchange_rate(args):
+ if not args.price_list:
+ return {}
+
price_list_currency = get_price_list_currency(args.price_list)
plc_conversion_rate = args.plc_conversion_rate
diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py
index a7f4630..9b51bfd 100644
--- a/erpnext/stock/reorder_item.py
+++ b/erpnext/stock/reorder_item.py
@@ -3,6 +3,7 @@
import frappe
from frappe.utils import flt, cstr, nowdate, add_days, cint
+from frappe import _
def reorder_item():
""" Reorder item if stock reaches reorder level"""
@@ -162,17 +163,12 @@
and r.role in ('Purchase Manager','Stock Manager')
and p.name not in ('Administrator', 'All', 'Guest')""")
- msg="""<h3>Following Material Requests has been raised automatically \
- based on item reorder level:</h3>"""
- for mr in mr_list:
- msg += "<p><b><u>" + mr.name + """</u></b></p><table class='table table-bordered'><tr>
- <th>Item Code</th><th>Warehouse</th><th>Qty</th><th>UOM</th></tr>"""
- for item in mr.get("items"):
- msg += "<tr><td>" + item.item_code + "</td><td>" + item.warehouse + "</td><td>" + \
- cstr(item.qty) + "</td><td>" + cstr(item.uom) + "</td></tr>"
- msg += "</table>"
+ msg = frappe.render_template("templates/emails/reorder_item.html", {
+ "mr_list": mr_list
+ })
+
frappe.sendmail(recipients=email_list,
- subject='Auto Material Request Generation Notification', message = msg)
+ subject=_('Auto Material Requests Generated'), message = msg)
def notify_errors(exceptions_list):
subject = "[Important] [ERPNext] Auto Reorder Errors"
diff --git a/erpnext/templates/emails/reorder_item.html b/erpnext/templates/emails/reorder_item.html
new file mode 100644
index 0000000..c4039e3
--- /dev/null
+++ b/erpnext/templates/emails/reorder_item.html
@@ -0,0 +1,29 @@
+<p>{{ _("Following Material Requests have been raised automatically based on Item's re-order level") + ":" }}<p>
+{% for mr in mr_list -%}
+<div style="margin-bottom: 30px;">
+ <h4 style="margin-bottom: 5px;">{{ frappe.utils.get_link_to_form("Material Request", mr.name) }}</h4>
+ <table style="width: 100%; border-spacing: 0; border-collapse: collapse;">
+ <thead>
+ <tr>
+ <th style="border: 1px solid #d1d8dd; width: 35%; text-align: left; padding: 5px;">{{ _("Item") }}</th>
+ <th style="border: 1px solid #d1d8dd; width: 35%; text-align: left; padding: 5px;">{{ _("Warehouse") }}</th>
+ <th style="border: 1px solid #d1d8dd; width: 20%; text-align: right; padding: 5px;">{{ _("Quantity") }}</th>
+ <th style="border: 1px solid #d1d8dd; width: 10%; text-align: left; padding: 5px;">{{ _("UOM") }}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for item in mr.get("items") -%}
+ <tr>
+ <td style="border: 1px solid #d1d8dd; text-align: left; padding: 5px;">
+ <b>{{ item.item_code }}</b>
+ {% if item.item_code != item.item_name -%} <br> {{ item.item_name }} {%- endif %}
+ </td>
+ <td style="border: 1px solid #d1d8dd; text-align: left; padding: 5px;">{{ item.warehouse }}</td>
+ <td style="border: 1px solid #d1d8dd; text-align: right; padding: 5px;">{{ item.qty }}</td>
+ <td style="border: 1px solid #d1d8dd; text-align: left; padding: 5px;">{{ item.uom }}</td>
+ </tr>
+ {%- endfor %}
+ </tbody>
+ </table>
+</div>
+{%- endfor %}
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
index 046e6f6..45f6af0 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -46,15 +46,14 @@
</div>
<div class="col-sm-2 col-xs-3 text-right">
{{ d.qty }}
- {% if d.delivered_qty != None %}
+ {% if d.delivered_qty is defined and d.delivered_qty != None %}
<p class="text-muted small">{{
_("Delivered: {0}").format(d.delivered_qty) }}</p>
{% endif %}
</div>
<div class="col-sm-2 col-xs-3 text-right">
{{ d.get_formatted("amount") }}
- <!-- output of get_formatted("rate") is unicode, to replace unicode use
- _("text {0}").decode("utf8").format(val) -->
+ {# output of get_formatted("rate") is unicode, to replace unicode use _("text {0}").decode("utf8").format(val) #}
<p class="text-muted small">{{
_("Rate: {0}").decode("utf8").format(d.get_formatted("rate")) }}</p>
</div>
diff --git a/setup.py b/setup.py
index 72b69b6..a3bf6ea 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = "6.11.0"
+version = "6.11.1"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()
diff --git a/sponsors.md b/sponsors.md
index bfa9e51..125b358 100644
--- a/sponsors.md
+++ b/sponsors.md
@@ -53,5 +53,13 @@
Leave Allocation based on Arbitrary Dates <a href="https://github.com/frappe/erpnext/issues/1938">#1938</a>
</td>
</tr>
+ <tr>
+ <td style="width: 30%">
+ <a href="http://agtech.com.sq">AG Technologies, Singapore</a>
+ </td>
+ <td>
+ Bulk edit via export-import in Bank Reconciliation <a href="https://github.com/frappe/erpnext/issues/1938">#4356</a>
+ </td>
+ </tr>
</tbody>
</table>