From aea87735034acb48b7284f9c63d63ac0a3538771 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Sat, 15 May 2021 12:23:05 +0530 Subject: [PATCH 01/31] feat: Increase number of supported currency exchanges Switch from frankfurter.app to exchangerate.host to accomodate more currency usage. Closes #25603 --- erpnext/setup/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index ffd5ab1e840..e66b1b5331a 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -98,10 +98,10 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No if not value: import requests - api_url = "https://frankfurter.app/{0}".format(transaction_date) + api_url = "https://api.exchangerate.host/latest" response = requests.get(api_url, params={ - "base": from_currency, - "symbols": to_currency + "symbols": from_currency+","+to_currency, + "base": from_currency }) # expire in 6 hours response.raise_for_status() From 5cced71ce41cdb10cd633830db20a034dec002af Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Sun, 16 May 2021 12:43:57 +0530 Subject: [PATCH 02/31] fix: Get the exchange rate based on date. --- erpnext/setup/utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index e66b1b5331a..33af28687c6 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -93,19 +93,20 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No try: cache = frappe.cache() - key = "currency_exchange_rate_{0}:{1}:{2}".format(transaction_date,from_currency, to_currency) + key = "currency_exchange_rate_{0}:{1}:{2}".format(transaction_date, from_currency, to_currency) value = cache.get(key) if not value: import requests - api_url = "https://api.exchangerate.host/latest" + api_url = "https://api.exchangerate.host/convert" response = requests.get(api_url, params={ - "symbols": from_currency+","+to_currency, - "base": from_currency + "date": transaction_date, + "from": from_currency, + "to": to_currency }) # expire in 6 hours response.raise_for_status() - value = response.json()["rates"][to_currency] + value = response.json()["result"] cache.setex(key, value, 6 * 60 * 60) return flt(value) except: From 6ec804d77fd899da5abbaf78c3b78f9f78405715 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Fri, 21 May 2021 18:16:21 +0530 Subject: [PATCH 03/31] fix: Update hard coded exchange rate values for testing --- .../currency_exchange/test_currency_exchange.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py index c5c01c57758..51bd1c4d535 100644 --- a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py @@ -63,11 +63,11 @@ class TestCurrencyExchange(unittest.TestCase): exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling") self.assertEqual(exchange_rate, 62.9) - # Exchange rate as on 15th Dec, 2015, should be fetched from fixer.io + # Exchange rate as on 15th Dec, 2015 self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_selling") self.assertFalse(exchange_rate == 60) - self.assertEqual(flt(exchange_rate, 3), 66.894) + self.assertEqual(flt(exchange_rate, 3), 66.999) def test_exchange_rate_strict(self): # strict currency settings @@ -77,15 +77,14 @@ class TestCurrencyExchange(unittest.TestCase): exchange_rate = get_exchange_rate("USD", "INR", "2016-01-01", "for_buying") self.assertEqual(exchange_rate, 60.0) - # Will fetch from fixer.io self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") - self.assertEqual(flt(exchange_rate, 3), 67.79) + self.assertEqual(flt(exchange_rate, 3), 67.235) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling") self.assertEqual(exchange_rate, 62.9) - # Exchange rate as on 15th Dec, 2015, should be fetched from fixer.io + # Exchange rate as on 15th Dec, 2015 self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_buying") self.assertEqual(flt(exchange_rate, 3), 66.894) @@ -111,4 +110,4 @@ class TestCurrencyExchange(unittest.TestCase): # Will fetch from fixer.io self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") - self.assertEqual(flt(exchange_rate, 3), 67.79) + self.assertEqual(flt(exchange_rate, 3), 67.235) From 88bab1e3ad83dd0584ca4f32b55ae1d5afb66855 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Fri, 21 May 2021 23:02:55 +0530 Subject: [PATCH 04/31] fix: update test suite --- .../test_currency_exchange.py | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py index 51bd1c4d535..5170d35ce28 100644 --- a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py @@ -55,13 +55,13 @@ class TestCurrencyExchange(unittest.TestCase): # Start with allow_stale is True exchange_rate = get_exchange_rate("USD", "INR", "2016-01-01", "for_buying") - self.assertEqual(flt(exchange_rate, 3), 60.0) + self.assertEqual(flt(exchange_rate, 3), 65.444) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") - self.assertEqual(exchange_rate, 65.1) + self.assertEqual(exchange_rate, 67.2) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling") - self.assertEqual(exchange_rate, 62.9) + self.assertEqual(exchange_rate, 68.0) # Exchange rate as on 15th Dec, 2015 self.clear_cache() @@ -75,34 +75,24 @@ class TestCurrencyExchange(unittest.TestCase): frappe.db.set_value("Accounts Settings", None, "stale_days", 1) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-01", "for_buying") - self.assertEqual(exchange_rate, 60.0) + self.assertEqual(exchange_rate, 65.4) self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") self.assertEqual(flt(exchange_rate, 3), 67.235) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling") - self.assertEqual(exchange_rate, 62.9) + self.assertEqual(exchange_rate, 68.0) # Exchange rate as on 15th Dec, 2015 self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_buying") - self.assertEqual(flt(exchange_rate, 3), 66.894) - - exchange_rate = get_exchange_rate("INR", "NGN", "2016-01-10", "for_selling") - self.assertEqual(exchange_rate, 65.1) - - # NGN is not available on fixer.io so these should return 0 - exchange_rate = get_exchange_rate("INR", "NGN", "2016-01-09", "for_selling") - self.assertEqual(exchange_rate, 0) - - exchange_rate = get_exchange_rate("INR", "NGN", "2016-01-11", "for_selling") - self.assertEqual(exchange_rate, 0) + self.assertEqual(flt(exchange_rate, 3), 66.999) def test_exchange_rate_strict_switched(self): # Start with allow_stale is True exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") - self.assertEqual(exchange_rate, 65.1) + self.assertEqual(exchange_rate, 67.2) frappe.db.set_value("Accounts Settings", None, "allow_stale", 0) frappe.db.set_value("Accounts Settings", None, "stale_days", 1) From 5271ce36de5b4c499e2e1e28db89e3325356258e Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Sat, 22 May 2021 11:22:02 +0530 Subject: [PATCH 05/31] fix: Update test values --- .../currency_exchange/test_currency_exchange.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py index 5170d35ce28..4ff2dd7e0e9 100644 --- a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py @@ -55,14 +55,14 @@ class TestCurrencyExchange(unittest.TestCase): # Start with allow_stale is True exchange_rate = get_exchange_rate("USD", "INR", "2016-01-01", "for_buying") - self.assertEqual(flt(exchange_rate, 3), 65.444) + self.assertEqual(flt(exchange_rate, 3), 60.0) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") - self.assertEqual(exchange_rate, 67.2) + self.assertEqual(exchange_rate, 65.1) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling") - self.assertEqual(exchange_rate, 68.0) - + self.assertEqual(exchange_rate, 62.9) + # Exchange rate as on 15th Dec, 2015 self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_selling") @@ -75,14 +75,14 @@ class TestCurrencyExchange(unittest.TestCase): frappe.db.set_value("Accounts Settings", None, "stale_days", 1) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-01", "for_buying") - self.assertEqual(exchange_rate, 65.4) + self.assertEqual(exchange_rate, 60.0) self.clear_cache() exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") self.assertEqual(flt(exchange_rate, 3), 67.235) exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling") - self.assertEqual(exchange_rate, 68.0) + self.assertEqual(exchange_rate, 62.9) # Exchange rate as on 15th Dec, 2015 self.clear_cache() @@ -92,7 +92,7 @@ class TestCurrencyExchange(unittest.TestCase): def test_exchange_rate_strict_switched(self): # Start with allow_stale is True exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying") - self.assertEqual(exchange_rate, 67.2) + self.assertEqual(exchange_rate, 65.1) frappe.db.set_value("Accounts Settings", None, "allow_stale", 0) frappe.db.set_value("Accounts Settings", None, "stale_days", 1) From 371d124a0ec5391f0ddf6b484056b33837d4257c Mon Sep 17 00:00:00 2001 From: hasnain2808 Date: Wed, 9 Jun 2021 18:40:15 +0530 Subject: [PATCH 06/31] fix: do not translate issue priority --- erpnext/setup/setup_wizard/operations/install_fixtures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index 85e070a97f7..77c387ab931 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -175,9 +175,9 @@ def install(country=None): ]}, # Issue Priority - {'doctype': 'Issue Priority', 'name': _('Low')}, - {'doctype': 'Issue Priority', 'name': _('Medium')}, - {'doctype': 'Issue Priority', 'name': _('High')}, + {'doctype': 'Issue Priority', 'name': 'Low'}, + {'doctype': 'Issue Priority', 'name': 'Medium'}, + {'doctype': 'Issue Priority', 'name': 'High'}, #Job Applicant Source {'doctype': 'Job Applicant Source', 'source_name': _('Website Listing')}, From 1b8670b2634f9a6cc9b9bd9150ef31ef82264710 Mon Sep 17 00:00:00 2001 From: Jannat Patel <31363128+pateljannat@users.noreply.github.com> Date: Tue, 13 Jul 2021 15:29:58 +0530 Subject: [PATCH 07/31] fix: Removed company filter for Loan Type (#26463) --- erpnext/hr/doctype/loan/loan.js | 9 --------- erpnext/hr/doctype/loan_application/loan_application.js | 7 ------- 2 files changed, 16 deletions(-) diff --git a/erpnext/hr/doctype/loan/loan.js b/erpnext/hr/doctype/loan/loan.js index 97504980225..3f5c30c4758 100644 --- a/erpnext/hr/doctype/loan/loan.js +++ b/erpnext/hr/doctype/loan/loan.js @@ -15,15 +15,6 @@ frappe.ui.form.on('Loan', { }; }); - frm.set_query("loan_type", function () { - return { - "filters": { - "docstatus": 1, - "company": frm.doc.company - } - }; - }); - frm.set_query("interest_income_account", function () { return { "filters": { diff --git a/erpnext/hr/doctype/loan_application/loan_application.js b/erpnext/hr/doctype/loan_application/loan_application.js index e150a220b86..eae419accab 100644 --- a/erpnext/hr/doctype/loan_application/loan_application.js +++ b/erpnext/hr/doctype/loan_application/loan_application.js @@ -7,13 +7,6 @@ frappe.ui.form.on('Loan Application', { refresh: function(frm) { frm.trigger("toggle_fields"); frm.trigger("add_toolbar_buttons"); - frm.set_query('loan_type', () => { - return { - filters: { - company: frm.doc.company - } - }; - }); }, repayment_method: function(frm) { frm.doc.repayment_amount = frm.doc.repayment_periods = "" From 5399891b25ac59d462a20568d26e6fdeb040e679 Mon Sep 17 00:00:00 2001 From: Jannat Patel <31363128+pateljannat@users.noreply.github.com> Date: Wed, 14 Jul 2021 14:43:59 +0530 Subject: [PATCH 08/31] fix: task status loop (#26007) --- erpnext/projects/doctype/task/task.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 6238306ae25..75cd6219908 100755 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -73,9 +73,6 @@ class Task(NestedSet): if (self.progress or 0) > 100: frappe.throw(_("Progress % for a task cannot be more than 100.")) - if self.progress == 100: - self.status = 'Completed' - if self.status == 'Completed': self.progress = 100 From 24e1786e4910c85b35cfffd72a98b78732bdb274 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 14 Jul 2021 22:52:40 +0530 Subject: [PATCH 09/31] fix: taxes not set correctly when items pulled from PO to PI --- erpnext/stock/doctype/purchase_receipt/purchase_receipt.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 27946586eaa..d530a966778 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -22,7 +22,7 @@ frappe.ui.form.on("Purchase Receipt", { frappe.set_route("Form", lcv.doctype, lcv.name); }, } - + frm.custom_make_buttons = { 'Stock Entry': 'Return', 'Purchase Invoice': 'Purchase Invoice' @@ -34,7 +34,7 @@ frappe.ui.form.on("Purchase Receipt", { filters: {'company': frm.doc.company } } }); - + }, onload: function(frm) { erpnext.queries.setup_queries(frm, "Warehouse", function() { @@ -107,6 +107,8 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend message: __("Please Select a Supplier") }); } + + me.frm.doc.taxes = []; erpnext.utils.map_current_doc({ method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt", source_doctype: "Purchase Order", From b22cbb31224bc417ce39d99cc4d926c63a820116 Mon Sep 17 00:00:00 2001 From: Noah Jacob Date: Fri, 16 Jul 2021 15:01:14 +0530 Subject: [PATCH 10/31] fix: validation check when no conversion_factor (#26528) --- erpnext/stock/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 1fc9f202fed..43a7c5dd48f 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -316,13 +316,16 @@ def update_included_uom_in_report(columns, result, include_uom, conversion_facto for row_idx, row in enumerate(result): data = row.items() if is_dict_obj else enumerate(row) for key, value in data: - if key not in convertible_columns or not conversion_factors[row_idx-1]: + if key not in convertible_columns: continue + # If no conversion factor for the UOM, defaults to 1 + if not conversion_factors[row_idx]: + conversion_factors[row_idx] = 1 if convertible_columns.get(key) == 'rate': - new_value = flt(value) * conversion_factors[row_idx-1] + new_value = flt(value) * conversion_factors[row_idx] else: - new_value = flt(value) / conversion_factors[row_idx-1] + new_value = flt(value) / conversion_factors[row_idx] if not is_dict_obj: row.insert(key+1, new_value) @@ -370,4 +373,4 @@ def add_additional_uom_columns(columns, result, include_uom, conversion_factors) else: row[data.converted_col] = flt(value_before_conversion) / conversion_factor - result[row_idx] = row \ No newline at end of file + result[row_idx] = row From 01f8833bd1836d4e5d1eea66a475bc714c9f0c45 Mon Sep 17 00:00:00 2001 From: Subin Tom <36098155+nemesis189@users.noreply.github.com> Date: Tue, 20 Jul 2021 21:04:10 +0530 Subject: [PATCH 11/31] fix: Fixed clearing issue of payment references on setting cost center (#26548) Co-authored-by: Subin Tom Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com> --- .../accounts/doctype/payment_entry/payment_entry.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 0bd54cd6055..bd6acb8dcb5 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -1041,18 +1041,10 @@ frappe.ui.form.on('Payment Entry', { }, callback: function(r, rt) { if(r.message) { - frappe.run_serially([ - () => { + frm.set_value("paid_from_account_balance", r.message.paid_from_account_balance); frm.set_value("paid_to_account_balance", r.message.paid_to_account_balance); frm.set_value("party_balance", r.message.party_balance); - }, - () => { - if(frm.doc.payment_type != "Internal") { - frm.clear_table("references"); - } - } - ]); } } From 2e5a358e9617be8efe2a661008788aef0c2f7744 Mon Sep 17 00:00:00 2001 From: pateljannat Date: Fri, 23 Jul 2021 13:06:57 +0530 Subject: [PATCH 12/31] fix: salary component account filter --- erpnext/hr/doctype/salary_component/salary_component.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/salary_component/salary_component.js b/erpnext/hr/doctype/salary_component/salary_component.js index c455eb3303b..f2a0e2e715d 100644 --- a/erpnext/hr/doctype/salary_component/salary_component.js +++ b/erpnext/hr/doctype/salary_component/salary_component.js @@ -5,10 +5,17 @@ frappe.ui.form.on('Salary Component', { setup: function(frm) { frm.set_query("default_account", "accounts", function(doc, cdt, cdn) { var d = locals[cdt][cdn]; + + var root_type = "Liability"; + if (frm.doc.type == "Deduction") { + root_type = "Expense"; + } + return { filters: { "is_group": 0, - "company": d.company + "company": d.company, + "root_type": root_type } }; }); From c908add82edbcf1b636bc8f44e4f58572c937b6a Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 25 Jul 2021 19:46:20 +0530 Subject: [PATCH 13/31] fix: Exchange rate revaluation posting date and precision fixes --- .../exchange_rate_revaluation.py | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index 9594706d0f6..7d562d6c57f 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -81,10 +81,12 @@ class ExchangeRateRevaluation(Document): sum(debit) - sum(credit) as balance from `tabGL Entry` where account in (%s) + and posting_date <= %s + and is_cancelled = 0 group by account, party_type, party having sum(debit) != sum(credit) order by account - """ % ', '.join(['%s']*len(accounts)), tuple(accounts), as_dict=1) + """ % (', '.join(['%s']*len(accounts)), '%s'), tuple(accounts + [self.posting_date]), as_dict=1) return account_details @@ -124,9 +126,9 @@ class ExchangeRateRevaluation(Document): "party_type": d.get("party_type"), "party": d.get("party"), "account_currency": d.get("account_currency"), - "balance": d.get("balance_in_account_currency"), - dr_or_cr: abs(d.get("balance_in_account_currency")), - "exchange_rate":d.get("new_exchange_rate"), + "balance": flt(d.get("balance_in_account_currency"), d.precision("balance_in_account_currency")), + dr_or_cr: flt(abs(d.get("balance_in_account_currency")), d.precision("balance_in_account_currency")), + "exchange_rate": flt(d.get("new_exchange_rate"), d.precision("new_exchange_rate")), "reference_type": "Exchange Rate Revaluation", "reference_name": self.name, }) @@ -135,9 +137,9 @@ class ExchangeRateRevaluation(Document): "party_type": d.get("party_type"), "party": d.get("party"), "account_currency": d.get("account_currency"), - "balance": d.get("balance_in_account_currency"), - reverse_dr_or_cr: abs(d.get("balance_in_account_currency")), - "exchange_rate": d.get("current_exchange_rate"), + "balance": flt(d.get("balance_in_account_currency"), d.precision("balance_in_account_currency")), + reverse_dr_or_cr: flt(abs(d.get("balance_in_account_currency")), d.precision("balance_in_account_currency")), + "exchange_rate": flt(d.get("current_exchange_rate"), d.precision("current_exchange_rate")), "reference_type": "Exchange Rate Revaluation", "reference_name": self.name }) @@ -166,9 +168,9 @@ def get_account_details(account, company, posting_date, party_type=None, party=N account_details = {} company_currency = erpnext.get_company_currency(company) - balance = get_balance_on(account, party_type=party_type, party=party, in_account_currency=False) + balance = get_balance_on(account, date=posting_date, party_type=party_type, party=party, in_account_currency=False) if balance: - balance_in_account_currency = get_balance_on(account, party_type=party_type, party=party) + balance_in_account_currency = get_balance_on(account, date=posting_date, party_type=party_type, party=party) current_exchange_rate = balance / balance_in_account_currency if balance_in_account_currency else 0 new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date) new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate From 12c3e5dfd6268ed56aad7ba4404a3833979c1aeb Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 25 Jul 2021 21:27:56 +0530 Subject: [PATCH 14/31] fix: Remove unintended changes --- .../exchange_rate_revaluation/exchange_rate_revaluation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index 7d562d6c57f..d56f5b660f6 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -82,7 +82,6 @@ class ExchangeRateRevaluation(Document): from `tabGL Entry` where account in (%s) and posting_date <= %s - and is_cancelled = 0 group by account, party_type, party having sum(debit) != sum(credit) order by account From b549287b94d69cc780fd0a941a1226a0801d165e Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 25 Jul 2021 21:26:22 +0530 Subject: [PATCH 15/31] fix: Convert null values to empty string on grouping --- .../exchange_rate_revaluation/exchange_rate_revaluation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index d56f5b660f6..8d47bcbd118 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -82,7 +82,7 @@ class ExchangeRateRevaluation(Document): from `tabGL Entry` where account in (%s) and posting_date <= %s - group by account, party_type, party + group by account, NULLIF(party_type,''), NULLIF(party,'') having sum(debit) != sum(credit) order by account """ % (', '.join(['%s']*len(accounts)), '%s'), tuple(accounts + [self.posting_date]), as_dict=1) From 27ecb54b8cd437e6a39e751f3fdd25be5e0c8903 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 27 Jul 2021 17:48:59 +0530 Subject: [PATCH 16/31] fix: Deadlock while doing payment reconciliation --- erpnext/accounts/general_ledger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index f42899ab5d9..6b2f8e3e88a 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -294,7 +294,8 @@ def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None, select account, posting_date, party_type, party, cost_center, fiscal_year,voucher_type, voucher_no, against_voucher_type, against_voucher, cost_center, company from `tabGL Entry` - where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no), as_dict=True) + where voucher_type=%s and voucher_no=%s + for update""", (voucher_type, voucher_no), as_dict=True) if gl_entries: validate_accounting_period(gl_entries) From 239974c73eb3c25f2a7b1d8cfaacbf91e5a98eec Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Thu, 29 Jul 2021 16:00:35 +0530 Subject: [PATCH 17/31] fix issue with cache.setex --- erpnext/setup/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index 33af28687c6..27237bf2cbe 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -107,7 +107,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No # expire in 6 hours response.raise_for_status() value = response.json()["result"] - cache.setex(key, value, 6 * 60 * 60) + cache.setex(name=key, time=21600, value=flt(value)) return flt(value) except: frappe.log_error(title="Get Exchange Rate") From b1e932a6f8b7a91ddd71818806ad924f7f673fa7 Mon Sep 17 00:00:00 2001 From: Ankush Date: Thu, 29 Jul 2021 19:56:36 +0530 Subject: [PATCH 18/31] fix: remove incorrect condition in GLE comparison (#26713) --- erpnext/controllers/stock_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 5370f4c571c..005d069c49a 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -418,7 +418,7 @@ def compare_existing_and_expected_gle(existing_gle, expected_gle): for e in existing_gle: if entry.account == e.account: account_existed = True - if entry.account == e.account and entry.against_account == e.against_account \ + if entry.account == e.account \ and (not entry.cost_center or not e.cost_center or entry.cost_center == e.cost_center) \ and (entry.debit != e.debit or entry.credit != e.credit): matched = False From 09d5ddc42ba4b3d5beb03ca9bfa2374ab0f9d047 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Wed, 4 Aug 2021 14:03:01 +0530 Subject: [PATCH 19/31] fix: bank remittance report issue (#26398) (#26767) --- erpnext/hr/report/bank_remittance/bank_remittance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/report/bank_remittance/bank_remittance.py b/erpnext/hr/report/bank_remittance/bank_remittance.py index b2d2c530247..7a459630a3c 100644 --- a/erpnext/hr/report/bank_remittance/bank_remittance.py +++ b/erpnext/hr/report/bank_remittance/bank_remittance.py @@ -89,6 +89,7 @@ def execute(filters=None): "amount": salary.net_pay, } data.append(row) + return columns, data def get_bank_accounts(): @@ -110,7 +111,7 @@ def get_payroll_entries(accounts, filters): entries = get_all("Payroll Entry", payroll_filter, ["name", "payment_account"]) payment_accounts = [d.payment_account for d in entries] - set_company_account(payment_accounts, entries) + entries = set_company_account(payment_accounts, entries) return entries def get_salary_slips(payroll_entries): From 8eca908365603048ca2c5a880cc11b385609b765 Mon Sep 17 00:00:00 2001 From: Ahmad <7881486+ahmadpak@users.noreply.github.com> Date: Mon, 9 Aug 2021 11:47:11 +0500 Subject: [PATCH 20/31] perf: speed up validate_account_for_perpetual_inventory (#26730) --- erpnext/accounts/general_ledger.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index f42899ab5d9..ca197476c98 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -147,7 +147,7 @@ def make_entry(args, adv_adj, update_outstanding, from_repost=False): gle.submit() def validate_account_for_perpetual_inventory(gl_map): - if cint(erpnext.is_perpetual_inventory_enabled(gl_map[0].company)): + if cint(erpnext.is_perpetual_inventory_enabled(gl_map[0].company)) and gl_map[0].voucher_type=="Journal Entry": account_list = [gl_entries.account for gl_entries in gl_map] aii_accounts = [d.name for d in frappe.get_all("Account", @@ -160,13 +160,12 @@ def validate_account_for_perpetual_inventory(gl_map): account_bal, stock_bal, warehouse_list = get_stock_and_account_balance(account, gl_map[0].posting_date, gl_map[0].company) - if gl_map[0].voucher_type=="Journal Entry": - # In case of Journal Entry, there are no corresponding SL entries, - # hence deducting currency amount - account_bal -= flt(gl_map[0].debit) - flt(gl_map[0].credit) - if account_bal == stock_bal: - frappe.throw(_("Account: {0} can only be updated via Stock Transactions") - .format(account), StockAccountInvalidTransaction) + # In case of Journal Entry, there are no corresponding SL entries, + # hence deducting currency amount + account_bal -= flt(gl_map[0].debit) - flt(gl_map[0].credit) + if account_bal == stock_bal: + frappe.throw(_("Account: {0} can only be updated via Stock Transactions") + .format(account), StockAccountInvalidTransaction) # This has been comment for a temporary, will add this code again on release of immutable ledger # elif account_bal != stock_bal: From 611966c1399c00d10c24577409834a87f4c1b8d9 Mon Sep 17 00:00:00 2001 From: Saqib Date: Tue, 10 Aug 2021 17:19:24 +0530 Subject: [PATCH 21/31] fix(e-invoicing): cannot cancel invoice if IRN cancelled on portal (#26880) --- erpnext/patches.txt | 1 + .../v12_0/show_einvoice_irn_cancelled_field.py | 12 ++++++++++++ erpnext/regional/india/setup.py | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 5afcd3150c0..acda0c1955c 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -686,3 +686,4 @@ erpnext.patches.v12_0.purchase_receipt_status erpnext.patches.v12_0.add_company_link_to_einvoice_settings erpnext.patches.v12_0.add_document_type_field_for_italy_einvoicing erpnext.patches.v12_0.create_taxable_value_field_in_purchase_invoice +erpnext.patches.v12_0.show_einvoice_irn_cancelled_field \ No newline at end of file diff --git a/erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py b/erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py new file mode 100644 index 00000000000..2319c17b34c --- /dev/null +++ b/erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + company = frappe.get_all('Company', filters = {'country': 'India'}) + if not company: + return + + irn_cancelled_field = frappe.db.exists('Custom Field', {'dt': 'Sales Invoice', 'fieldname': 'irn_cancelled'}) + if irn_cancelled_field: + frappe.db.set_value('Custom Field', irn_cancelled_field, 'depends_on', 'eval: doc.irn') + frappe.db.set_value('Custom Field', irn_cancelled_field, 'read_only', 0) diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index 81dcf36bd3c..c71d6bc7eaf 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -414,7 +414,7 @@ def make_custom_fields(update=True): dict(fieldname='ack_date', label='Ack. Date', fieldtype='Data', read_only=1, hidden=1, insert_after='ack_no', no_copy=1, print_hide=1), dict(fieldname='irn_cancelled', label='IRN Cancelled', fieldtype='Check', no_copy=1, print_hide=1, - depends_on='eval:(doc.irn_cancelled === 1)', read_only=1, allow_on_submit=1, insert_after='customer'), + depends_on='eval: doc.irn', allow_on_submit=1, insert_after='customer'), dict(fieldname='eway_bill_cancelled', label='E-Way Bill Cancelled', fieldtype='Check', no_copy=1, print_hide=1, depends_on='eval:(doc.eway_bill_cancelled === 1)', read_only=1, allow_on_submit=1, insert_after='customer'), From 2945e604aad7c554392d9d7a2c83a03af0ccdbc2 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Fri, 13 Aug 2021 15:44:13 +0530 Subject: [PATCH 22/31] fix: remove limit from stock balance report (bp #26773) (cherry picked from commit b3740e9afc375624dc478c97a97f757e06de084f) Co-authored-by: Ankush --- erpnext/stock/report/stock_balance/stock_balance.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 8ea98cba6f6..c1f48d78130 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -15,8 +15,6 @@ from six import iteritems def execute(filters=None): if not filters: filters = {} - validate_filters(filters) - from_date = filters.get('from_date') to_date = filters.get('to_date') @@ -293,12 +291,6 @@ def get_item_reorder_details(items): return dict((d.parent + d.warehouse, d) for d in item_reorder_details) -def validate_filters(filters): - if not (filters.get("item_code") or filters.get("warehouse")): - sle_count = flt(frappe.db.sql("""select count(name) from `tabStock Ledger Entry`""")[0][0]) - if sle_count > 500000: - frappe.throw(_("Please set filter based on Item or Warehouse due to a large amount of entries.")) - def get_variants_attributes(): '''Return all item variant attributes.''' return [i.name for i in frappe.get_all('Item Attribute')] From 8d71fcb9485a577211bef481a4786c2353685dee Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Fri, 13 Aug 2021 17:45:16 +0530 Subject: [PATCH 23/31] fix: fix Payment references from disappearing on adding Cost Center in Payment Entry (#26939) * fix: payment references from disappearing on selecting cost center (#24831) Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com> (cherry picked from commit 9bf1083d9e24221d01f0b05e77ecf1444e8bcaa7) # Conflicts: # erpnext/accounts/doctype/payment_entry/payment_entry.js * fix: conflicts * fix: conflicts Co-authored-by: Anuja Pawar <60467153+Anuja-pawar@users.noreply.github.com> Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com> --- .../accounts/doctype/payment_entry/payment_entry.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index bd6acb8dcb5..b0835e15372 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -593,12 +593,22 @@ frappe.ui.form.on('Payment Entry', { {fieldtype:"Column Break"}, {fieldtype:"Float", label: __("Less Than Amount"), fieldname:"outstanding_amt_less_than"}, {fieldtype:"Section Break"}, + {fieldtype:"Link", label:__("Cost Center"), fieldname:"cost_center", options:"Cost Center", + "get_query": function() { + return { + "filters": {"company": frm.doc.company} + } + } + }, + {fieldtype:"Column Break"}, + {fieldtype:"Section Break"}, {fieldtype:"Check", label: __("Allocate Payment Amount"), fieldname:"allocate_payment_amount", default:1}, ]; frappe.prompt(fields, function(filters){ frappe.flags.allocate_payment_amount = true; frm.events.validate_filters_data(frm, filters); + frm.doc.cost_center = filters.cost_center; frm.events.get_outstanding_documents(frm, filters); }, __("Filters"), __("Get Outstanding Documents")); }, From 24d67c35b784dd557fea12dacf5f3a1c2cec110f Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Tue, 17 Aug 2021 13:17:09 +0530 Subject: [PATCH 24/31] Merge pull request #26976 from resilient-tech/fix-incorrect-modified fix: Incorrect `modified` time in documents that inherit from `StatusUpdater` (cherry picked from commit d932cba38afc176e0e6384f9081c523d66c0320e) --- erpnext/controllers/status_updater.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 1615e901350..2b14aa9f865 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import flt, comma_or, nowdate, getdate +from frappe.utils import flt, comma_or, nowdate, getdate, now from frappe import _ from frappe.model.document import Document @@ -307,10 +307,14 @@ class StatusUpdater(Document): target.notify_update() def _update_modified(self, args, update_modified): - args['update_modified'] = '' - if update_modified: - args['update_modified'] = ', modified = now(), modified_by = {0}'\ - .format(frappe.db.escape(frappe.session.user)) + if not update_modified: + args['update_modified'] = '' + return + + args['update_modified'] = ', modified = {0}, modified_by = {1}'.format( + frappe.db.escape(now()), + frappe.db.escape(frappe.session.user) + ) def update_billing_status_for_zero_amount_refdoc(self, ref_dt): ref_fieldname = frappe.scrub(ref_dt) From bdfc300896309d0b3ab04d6eccc023a57f8e71ab Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Tue, 17 Aug 2021 12:03:26 +0200 Subject: [PATCH 25/31] fix: item name is missing into job card (#26956) --- erpnext/manufacturing/doctype/work_order/work_order.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.json b/erpnext/manufacturing/doctype/work_order/work_order.json index 6152fbb8402..35462b71b68 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.json +++ b/erpnext/manufacturing/doctype/work_order/work_order.json @@ -107,6 +107,8 @@ }, { "depends_on": "eval:doc.production_item", + "fetch_from": "production_item.item_name", + "fetch_if_empty": 1, "fieldname": "item_name", "fieldtype": "Data", "label": "Item Name", @@ -470,7 +472,7 @@ "image_field": "image", "is_submittable": 1, "links": [], - "modified": "2019-12-04 11:20:04.695123", + "modified": "2021-08-16 11:20:04.695123", "modified_by": "Administrator", "module": "Manufacturing", "name": "Work Order", From 0fd50e0426d67d6cf340870a931a6a0dd67a5a10 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 18 Aug 2021 13:32:22 +0530 Subject: [PATCH 26/31] fix(deps): pin plaid-python to 7.2.x (#26996) * fix(deps): pin plaid-python to 7.2.x Old requirement.txt was allowing next major version which has breaking changes and causes failure in installation. * fix(deps): remove frappe from requirements.txt --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c49b3f5c707..9f8379c3a9a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ braintree==3.57.1 -frappe +# frappe # https://github.com/frappe/frappe is installed during bench-init gocardless-pro==1.11.0 googlemaps==3.1.1 pandas==0.24.2 -plaid-python>=7.0.0 +plaid-python~=7.2.1 PyGithub==1.44.1 python-stdnum==1.12 Unidecode==1.1.1 From 5bb9de86141a5d64a4782f34ae86dba6ce3741ae Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 18 Aug 2021 17:00:07 +0530 Subject: [PATCH 27/31] ci: backport action on v12 (#27009) [skip ci] --- .github/workflows/backport.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 00000000000..bd622275d6d --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,26 @@ +name: Backport +on: + pull_request_target: + types: + - closed + - labeled + +jobs: + main: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout Actions + uses: actions/checkout@v2 + with: + repository: "frappe/backport" + path: ./actions + ref: develop + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Run backport + uses: ./actions/backport + with: + token: ${{secrets.BACKPORT_BOT_TOKEN}} + labelsToAdd: "backport" + title: "{{originalTitle}}" From d8a7abcd02f674bf6c4270a817ae9762a0b57140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BCrker=20Tunal=C4=B1?= Date: Wed, 18 Aug 2021 15:13:58 +0300 Subject: [PATCH 28/31] fix: date_unchanged calculation in "Update Items" (#26992) Branch corrected https://github.com/frappe/erpnext/pull/26058 ERPNext generates "Cannot set quantity less than delivered quantity" error even the delivered qty is zero when user clicks "Update Items". "date_unchanged" variable gets false value because of new_date is string. "getdate(new_date)" corrects the date comparison. ![ERPNext_PR](https://user-images.githubusercontent.com/710051/121928377-c0263180-cd48-11eb-8cd9-eda7dace09d6.gif) --- erpnext/controllers/accounts_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index f1e16ce59c4..762b4dcdb71 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1312,7 +1312,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil qty_unchanged = prev_qty == new_qty uom_unchanged = prev_uom == new_uom conversion_factor_unchanged = prev_con_fac == new_con_fac - date_unchanged = prev_date == new_date if prev_date and new_date else False # in case of delivery note etc + date_unchanged = prev_date == getdate(new_date) if prev_date and new_date else False # in case of delivery note etc if rate_unchanged and qty_unchanged and conversion_factor_unchanged and uom_unchanged and date_unchanged: continue From f8fa3860d98bf7a4f10ca9e91b31391549e9076f Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 19 Aug 2021 15:48:51 +0530 Subject: [PATCH 29/31] fix: equality check instead of assignment (#27029) * Merge pull request #27026 from ankush/eq_assign fix: equality check instead of assignment [skip ci] (cherry picked from commit 993b0532f8b9240c8cc5ac8fb56a202a783fab4f) * fix: equality check instead of assignment in cart port of https://github.com/frappe/erpnext/pull/25372 Co-authored-by: Ankush Menat --- erpnext/shopping_cart/cart.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index 0fded2ec6f7..891aeb0d609 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -206,11 +206,11 @@ def update_cart_address(address_type, address_name): if address_type.lower() == "billing": quotation.customer_address = address_name quotation.address_display = address_display - quotation.shipping_address_name == quotation.shipping_address_name or address_name + quotation.shipping_address_name = quotation.shipping_address_name or address_name elif address_type.lower() == "shipping": quotation.shipping_address_name = address_name quotation.shipping_address = address_display - quotation.customer_address == quotation.customer_address or address_name + quotation.customer_address = quotation.customer_address or address_name apply_cart_settings(quotation=quotation) @@ -279,7 +279,7 @@ def update_party(fullname, company_name=None, mobile_no=None, phone=None): party = get_party() party.customer_name = company_name or fullname - party.customer_type == "Company" if company_name else "Individual" + party.customer_type = "Company" if company_name else "Individual" contact_name = frappe.db.get_value("Contact", {"email_id": frappe.session.user}) contact = frappe.get_doc("Contact", contact_name) From 8064792b8ce02a4e219a8ed6667eea191630b03b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 19 Aug 2021 18:43:28 +0530 Subject: [PATCH 30/31] chore: change log for v12.24.0 --- erpnext/change_log/v12/v12_24_0.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 erpnext/change_log/v12/v12_24_0.md diff --git a/erpnext/change_log/v12/v12_24_0.md b/erpnext/change_log/v12/v12_24_0.md new file mode 100644 index 00000000000..5b2b4e7bd52 --- /dev/null +++ b/erpnext/change_log/v12/v12_24_0.md @@ -0,0 +1,13 @@ +## Version 12.24.0 Release Notes + +### Fixes & Enhancements +- Sales order qty update fails in "Update Items" button ([#26992](https://github.com/frappe/erpnext/pull/26992)) +- Speed up validate_account_for_perpetual_inventory ([#26730](https://github.com/frappe/erpnext/pull/26730)) +- Deadlock while doing payment reconciliation ([#26674](https://github.com/frappe/erpnext/pull/26674)) +- Remove incorrect condition in GLE comparison ([#26713](https://github.com/frappe/erpnext/pull/26713)) +- Cannot cancel invoice if IRN cancelled on portal ([#26880](https://github.com/frappe/erpnext/pull/26880)) +- Item name is missing into job card ([#26956](https://github.com/frappe/erpnext/pull/26956)) +- Removed company filter for Loan Type ([#26463](https://github.com/frappe/erpnext/pull/26463)) +- Exchange rate revaluation posting date and precision fixes ([#26629](https://github.com/frappe/erpnext/pull/26629)) +- Fixed clearing issue of payment references on setting cost center ([#26548](https://github.com/frappe/erpnext/pull/26548)) +- Increase number of supported currency exchanges ([#25722](https://github.com/frappe/erpnext/pull/25722)) \ No newline at end of file From 48bd1965e4bc63f534cc117c2d1c4e78b5e0e6fd Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 19 Aug 2021 20:40:07 +0550 Subject: [PATCH 31/31] bumped to version 12.24.0 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 4cd5982e877..d5412bf1b96 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '12.23.0' +__version__ = '12.24.0' def get_default_company(user=None): '''Get default company for user'''