From d487bf77e1d483c54bd1a5f6f30c9c60b20f4840 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Thu, 9 Feb 2017 12:36:44 +0530 Subject: [PATCH 1/9] [minor] payment entry company trigger --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index d3dbd314cc..2a2f9fff55 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -79,8 +79,13 @@ frappe.ui.form.on('Payment Entry', { frm.events.show_general_ledger(frm); }, + company: function(frm) { + frm.events.hide_unhide_fields(frm); + frm.events.set_dynamic_labels(frm); + }, + hide_unhide_fields: function(frm) { - var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency; + var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: ""; frm.toggle_display("source_exchange_rate", (frm.doc.paid_amount && frm.doc.paid_from_account_currency != company_currency)); @@ -118,7 +123,7 @@ frappe.ui.form.on('Payment Entry', { }, set_dynamic_labels: function(frm) { - var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency; + var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: ""; frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount", "difference_amount"], company_currency); From 2f09dc0e62e8c1008d7cc0f956ebf38c4e7df20c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 10 Feb 2017 12:44:04 +0530 Subject: [PATCH 2/9] [Fix] Valuation method changing issue in the item --- erpnext/stock/doctype/item/item.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 53faa43f24..ad1407a3de 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -451,6 +451,8 @@ class Item(WebsiteGenerator): "valuation_method", "has_batch_no", "is_fixed_asset") vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True) + if not vals.get('valuation_method'): + vals['valuation_method'] = frappe.db.get_single_value("Stock Settings", "valuation_method") or "FIFO" if vals: for key in to_check: From bdd470a6d13eefbf8c993ddea75f6e2417407632 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 10 Feb 2017 17:12:48 +0530 Subject: [PATCH 3/9] Update item.py --- erpnext/stock/doctype/item/item.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index ad1407a3de..4d5265f72a 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -451,7 +451,7 @@ class Item(WebsiteGenerator): "valuation_method", "has_batch_no", "is_fixed_asset") vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True) - if not vals.get('valuation_method'): + if not vals.get('valuation_method') and self.get('valuation_method'): vals['valuation_method'] = frappe.db.get_single_value("Stock Settings", "valuation_method") or "FIFO" if vals: From 1cd5e583badc4368be627f2ac49c059ca2017910 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Fri, 10 Feb 2017 17:58:41 +0530 Subject: [PATCH 4/9] [Fix] Apply Now button redirect fixed for Job Opening --- erpnext/templates/generators/job_opening.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/templates/generators/job_opening.html b/erpnext/templates/generators/job_opening.html index 5998e3f878..f92e72eaa7 100644 --- a/erpnext/templates/generators/job_opening.html +++ b/erpnext/templates/generators/job_opening.html @@ -15,7 +15,7 @@ {% endif %}

+ href='/job_application?new=1&job_title={{ doc.name }}'> {{ _("Apply Now") }}

From 99dfa3060a9dd703434892602def94f2e99b2254 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 13 Feb 2017 16:06:02 +0530 Subject: [PATCH 5/9] Check existing SO, PO and MR for disabling 'Is Stock Item' checkbox --- erpnext/stock/doctype/item/item.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 4d5265f72a..f8d6606b74 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -457,7 +457,7 @@ class Item(WebsiteGenerator): if vals: for key in to_check: if self.get(key) != vals.get(key): - if not self.check_if_linked_document_exists(): + if not self.check_if_linked_document_exists(key): break # no linked document, allowed else: frappe.throw(_("As there are existing transactions for this item, you can not change the value of {0}").format(frappe.bold(self.meta.get_label(key)))) @@ -467,10 +467,16 @@ class Item(WebsiteGenerator): if asset: frappe.throw(_('"Is Fixed Asset" cannot be unchecked, as Asset record exists against the item')) - def check_if_linked_document_exists(self): - for doctype in ("Sales Order Item", "Delivery Note Item", "Sales Invoice Item", - "Material Request Item", "Purchase Order Item", "Purchase Receipt Item", - "Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"): + def check_if_linked_document_exists(self, key): + linked_doctypes = ["Delivery Note Item", "Sales Invoice Item", "Purchase Receipt Item", + "Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"] + + # For "Is Stock Item", following doctypes is important + # because reserved_qty, ordered_qty and requested_qty updated from these doctypes + if key == "is_stock_item": + linked_doctypes += ["Sales Order Item", "Purchase Order Item", "Material Request Item"] + + for doctype in linked_doctypes: if frappe.db.get_value(doctype, filters={"item_code": self.name, "docstatus": 1}) or \ frappe.db.get_value("Production Order", filters={"production_item": self.name, "docstatus": 1}): From ff41c82c2bddf96a877046a3c77a333e76a5c316 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 14 Feb 2017 16:02:18 +0530 Subject: [PATCH 6/9] [Fix] Payment Entry currency symbol issue --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 2a2f9fff55..4cd86c6033 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -136,6 +136,10 @@ frappe.ui.form.on('Payment Entry', { frm.set_currency_labels(["total_allocated_amount", "unallocated_amount"], party_account_currency); + currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency" + frm.set_df_property("total_allocated_amount", "options", currency_field); + frm.set_df_property("unallocated_amount", "options", currency_field); + frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"], party_account_currency, "references"); From 3437a9a123861ccb765d6ba9bdf2a6819449ab9f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 Feb 2017 12:14:14 +0530 Subject: [PATCH 7/9] minor fix --- erpnext/stock/doctype/item/item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index f8d6606b74..d20ba49763 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -456,11 +456,11 @@ class Item(WebsiteGenerator): if vals: for key in to_check: - if self.get(key) != vals.get(key): + if cstr(self.get(key)) != cstr(vals.get(key)): if not self.check_if_linked_document_exists(key): break # no linked document, allowed else: - frappe.throw(_("As there are existing transactions for this item, you can not change the value of {0}").format(frappe.bold(self.meta.get_label(key)))) + frappe.throw(_("As there are existing transactions against item {0}, you can not change the value of {1}").format(self.name, frappe.bold(self.meta.get_label(key)))) if vals and not self.is_fixed_asset and self.is_fixed_asset != vals.is_fixed_asset: asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1) From 99c6c798345bab3499edf431ea0c6515339066c0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 Feb 2017 14:21:04 +0530 Subject: [PATCH 8/9] Update payment_entry.js --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 4cd86c6033..1bbe200651 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -136,7 +136,7 @@ frappe.ui.form.on('Payment Entry', { frm.set_currency_labels(["total_allocated_amount", "unallocated_amount"], party_account_currency); - currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency" + var currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency" frm.set_df_property("total_allocated_amount", "options", currency_field); frm.set_df_property("unallocated_amount", "options", currency_field); @@ -750,4 +750,4 @@ frappe.ui.form.on('Payment Entry Deduction', { deductions_remove: function(frm) { frm.events.set_difference_amount(frm); } -}) \ No newline at end of file +}) From 7677b56f7cb7f2940ae73f0b3504b4d357e4447a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 Feb 2017 15:07:48 +0600 Subject: [PATCH 9/9] bumped to version 7.2.20 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 706a8e5b2a..7ec8430f54 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.2.19' +__version__ = '7.2.20' def get_default_company(user=None): '''Get default company for user'''