From a0783de23253de6fa0509d77b94810d77b23144a Mon Sep 17 00:00:00 2001 From: Saqib Date: Thu, 22 Apr 2021 14:31:46 +0530 Subject: [PATCH 1/8] fix: remove invalid changes added due to merge conflict (#25405) * fix: merge conflict * fix: recover lost method --- erpnext/regional/india/e_invoice/utils.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py index 7637d2d4583..c9f0b0b2592 100644 --- a/erpnext/regional/india/e_invoice/utils.py +++ b/erpnext/regional/india/e_invoice/utils.py @@ -139,10 +139,6 @@ def get_party_details(address_name, is_shipping_address=False): address_line1=sanitize_for_json(addr.address_line1), address_line2=sanitize_for_json(addr.address_line2) )) - if d.gstin: - party_address_details.gstin = d.gstin - - return party_address_details return party_address_details @@ -427,7 +423,7 @@ def make_einvoice(invoice): item_list = get_item_list(invoice) doc_details = get_doc_details(invoice) invoice_value_details = get_invoice_value_details(invoice) - seller_details = get_party_details(invoice.company_address, company_address=1) + seller_details = get_party_details(invoice.company_address) if invoice.gst_category == 'Overseas': buyer_details = get_overseas_address_details(invoice.customer_address) @@ -448,7 +444,7 @@ def make_einvoice(invoice): if invoice.gst_category == 'Overseas': shipping_details = get_overseas_address_details(invoice.shipping_address_name) else: - shipping_details = get_party_details(invoice.shipping_address_name, shipping_address=True) + shipping_details = get_party_details(invoice.shipping_address_name, is_shipping_address=True) if invoice.is_pos and invoice.base_paid_amount: payment_details = get_payment_details(invoice) @@ -550,6 +546,13 @@ def safe_json_load(json_string): snippet = json_string[start:end] frappe.throw(_("Error in input data. Please check for any special characters near following input:
{}").format(snippet)) +def throw_error_list(errors, title): + if len(errors) > 1: + li = ['
  • '+ d +'
  • ' for d in errors] + frappe.throw("".format(''.join(li)), title=title) + else: + frappe.throw(errors[0], title=title) + class RequestFailed(Exception): pass class GSPConnector(): @@ -576,7 +579,7 @@ class GSPConnector(): gstin = self.get_seller_gstin() credentials_for_gstin = [d for d in self.e_invoice_settings.credentials if d.gstin == gstin] if credentials_for_gstin: - self.credentials = credentials_for_gstin[0] + credentials = credentials_for_gstin[0] else: frappe.throw(_('Cannot find e-invoicing credentials for selected Company GSTIN. Please check E-Invoice Settings')) else: From 96c099c6090eafc08b2954056111d2540a65eed2 Mon Sep 17 00:00:00 2001 From: Saqib Date: Mon, 26 Apr 2021 15:40:29 +0530 Subject: [PATCH 2/8] fix: remove invalid changes added due to merge conflicts (#25404) * fix: merge conflicts * fix: merge conflict * fix: recover lost method --- erpnext/regional/india/e_invoice/utils.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py index 7637d2d4583..c9f0b0b2592 100644 --- a/erpnext/regional/india/e_invoice/utils.py +++ b/erpnext/regional/india/e_invoice/utils.py @@ -139,10 +139,6 @@ def get_party_details(address_name, is_shipping_address=False): address_line1=sanitize_for_json(addr.address_line1), address_line2=sanitize_for_json(addr.address_line2) )) - if d.gstin: - party_address_details.gstin = d.gstin - - return party_address_details return party_address_details @@ -427,7 +423,7 @@ def make_einvoice(invoice): item_list = get_item_list(invoice) doc_details = get_doc_details(invoice) invoice_value_details = get_invoice_value_details(invoice) - seller_details = get_party_details(invoice.company_address, company_address=1) + seller_details = get_party_details(invoice.company_address) if invoice.gst_category == 'Overseas': buyer_details = get_overseas_address_details(invoice.customer_address) @@ -448,7 +444,7 @@ def make_einvoice(invoice): if invoice.gst_category == 'Overseas': shipping_details = get_overseas_address_details(invoice.shipping_address_name) else: - shipping_details = get_party_details(invoice.shipping_address_name, shipping_address=True) + shipping_details = get_party_details(invoice.shipping_address_name, is_shipping_address=True) if invoice.is_pos and invoice.base_paid_amount: payment_details = get_payment_details(invoice) @@ -550,6 +546,13 @@ def safe_json_load(json_string): snippet = json_string[start:end] frappe.throw(_("Error in input data. Please check for any special characters near following input:
    {}").format(snippet)) +def throw_error_list(errors, title): + if len(errors) > 1: + li = ['
  • '+ d +'
  • ' for d in errors] + frappe.throw("".format(''.join(li)), title=title) + else: + frappe.throw(errors[0], title=title) + class RequestFailed(Exception): pass class GSPConnector(): @@ -576,7 +579,7 @@ class GSPConnector(): gstin = self.get_seller_gstin() credentials_for_gstin = [d for d in self.e_invoice_settings.credentials if d.gstin == gstin] if credentials_for_gstin: - self.credentials = credentials_for_gstin[0] + credentials = credentials_for_gstin[0] else: frappe.throw(_('Cannot find e-invoicing credentials for selected Company GSTIN. Please check E-Invoice Settings')) else: From 5946c2f28e5a2c0733260399277349e6e54f6758 Mon Sep 17 00:00:00 2001 From: casesolved-co-uk Date: Wed, 14 Apr 2021 10:15:34 +0000 Subject: [PATCH 3/8] fix: plaid NoneType error #24675 --- .../doctype/plaid_settings/plaid_settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py index ae8abf2eb15..05b7d11b794 100644 --- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py +++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py @@ -146,8 +146,9 @@ def sync_transactions(bank, bank_account): transactions = get_transactions(bank=bank, bank_account=bank_account, start_date=start_date, end_date=end_date) result = [] - for transaction in reversed(transactions): - result += new_bank_transaction(transaction) + if transactions: + for transaction in reversed(transactions): + result += new_bank_transaction(transaction) if result: last_transaction_date = frappe.db.get_value('Bank Transaction', result.pop(), 'date') From df51aa30879410d49a90c8e35ccb9d8eb34e23db Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 14 May 2021 21:31:22 +0530 Subject: [PATCH 4/8] fix: Ignore rounding diff while importig JV using data import --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 709dccd2230..dbe8fe40923 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -29,7 +29,11 @@ class JournalEntry(AccountsController): self.validate_entries_for_advance() self.validate_multi_currency() self.set_amounts_in_company_currency() - self.validate_total_debit_and_credit() + + # Do not validate while importing via data import + if not frappe.flags.in_import: + self.validate_total_debit_and_credit() + self.validate_against_jv() self.validate_reference_doc() self.set_against_account() @@ -1047,4 +1051,4 @@ def make_reverse_journal_entry(source_name, target_doc=None): }, }, target_doc) - return doclist \ No newline at end of file + return doclist \ No newline at end of file From ad1f1e000bf536e9df103c6f5d313544b2b1bffb Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 18 May 2021 08:38:49 +0530 Subject: [PATCH 5/8] fix: Cashlfow mapper not showing data --- .../accounts/report/cash_flow/custom_cash_flow.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/report/cash_flow/custom_cash_flow.py b/erpnext/accounts/report/cash_flow/custom_cash_flow.py index 8566f5375ad..9907dde5482 100644 --- a/erpnext/accounts/report/cash_flow/custom_cash_flow.py +++ b/erpnext/accounts/report/cash_flow/custom_cash_flow.py @@ -165,7 +165,7 @@ def add_data_for_operating_activities( if profit_data: profit_data.update({ "indent": 1, - "parent_account": get_mapper_for(light_mappers, position=0)['section_header'] + "parent_account": get_mapper_for(light_mappers, position=1)['section_header'] }) data.append(profit_data) section_data.append(profit_data) @@ -312,10 +312,10 @@ def add_data_for_other_activities( def compute_data(filters, company_currency, profit_data, period_list, light_mappers, full_mapper): data = [] - operating_activities_mapper = get_mapper_for(light_mappers, position=0) + operating_activities_mapper = get_mapper_for(light_mappers, position=1) other_mappers = [ - get_mapper_for(light_mappers, position=1), - get_mapper_for(light_mappers, position=2) + get_mapper_for(light_mappers, position=2), + get_mapper_for(light_mappers, position=3) ] if operating_activities_mapper: @@ -396,7 +396,7 @@ def _get_account_type_based_data(filters, account_names, period_list, accumulate gl_sum = frappe.db.sql_list(""" select sum(credit) - sum(debit) from `tabGL Entry` - where company=%s and posting_date >= %s and posting_date <= %s + where company=%s and posting_date >= %s and posting_date <= %s and voucher_type != 'Period Closing Voucher' and account in ( SELECT name FROM tabAccount WHERE name IN (%s) OR parent_account IN (%s)) @@ -405,7 +405,7 @@ def _get_account_type_based_data(filters, account_names, period_list, accumulate gl_sum = frappe.db.sql_list(""" select sum(credit) - sum(debit) from `tabGL Entry` - where company=%s and posting_date >= %s and posting_date <= %s + where company=%s and posting_date >= %s and posting_date <= %s and voucher_type != 'Period Closing Voucher' and account in ( SELECT name FROM tabAccount WHERE name IN (%s) OR parent_account IN (%s)) From 4d9c9db295ea780f3c3dea1bcb806c426a6716dc Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 20 May 2021 18:49:42 +0530 Subject: [PATCH 6/8] chore: Added change log for v12.21.0 --- erpnext/change_log/v12/v12_21_0.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 erpnext/change_log/v12/v12_21_0.md diff --git a/erpnext/change_log/v12/v12_21_0.md b/erpnext/change_log/v12/v12_21_0.md new file mode 100644 index 00000000000..946bf09d9e4 --- /dev/null +++ b/erpnext/change_log/v12/v12_21_0.md @@ -0,0 +1,21 @@ +## Version 12.21.0 Release Notes + + +### Fixes & Enhancements + +- Incorrect qty calculated for sub-contracted raw materials in purchase receipt ([#25443](https://github.com/frappe/erpnext/pull/25443)) +- Update cost center in the item table fetched from POS Profile in v12 ([#25612](https://github.com/frappe/erpnext/pull/25612)) +- Total stock summary report not working ([#25552](https://github.com/frappe/erpnext/pull/25552)) +- Timeout error while loading warehouse tree ([#25693](https://github.com/frappe/erpnext/pull/25693)) +- RCM rounding precision ([#25410](https://github.com/frappe/erpnext/pull/25410)) +- Change subcontracted item display ([#25426](https://github.com/frappe/erpnext/pull/25426)) +- Remove invalid changes added due to merge conflict ([#25437](https://github.com/frappe/erpnext/pull/25437)) +- Add document type field for e-invoicing (Italy) ([#25420](https://github.com/frappe/erpnext/pull/25420)) +- Issue in project custom status ([#25453](https://github.com/frappe/erpnext/pull/25453)) +- Employee Separation ([#25504](https://github.com/frappe/erpnext/pull/25504)) +- State code for Other Territory ([#25422](https://github.com/frappe/erpnext/pull/25422)) +- Remove invalid changes added due to merge conflict ([#25405](https://github.com/frappe/erpnext/pull/25405)) +- Check for None in item.schedule_date before setting ([#25589](https://github.com/frappe/erpnext/pull/25589)) +- Can't multiply sequence by non-int of type 'float' ([#25385](https://github.com/frappe/erpnext/pull/25385)) +- Filter using purpose, make requested changes ([#25388](https://github.com/frappe/erpnext/pull/25388)) +- Purchase from registered composition dealer ([#25419](https://github.com/frappe/erpnext/pull/25419)) \ No newline at end of file From 65b7b57c70a7e429098711e8803bb000529a2ed8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 20 May 2021 19:11:42 +0550 Subject: [PATCH 7/8] bumped to version 12.21.0 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 566dd158a67..1fdf73a0595 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.20.0' +__version__ = '12.21.0' def get_default_company(user=None): '''Get default company for user''' From fa3ca02557a8cad330fb7c73a8977c2427961e4b Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Wed, 26 May 2021 12:16:25 +0530 Subject: [PATCH 8/8] fix: student invalid password reset link (#25827) --- erpnext/education/doctype/student/student.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/education/doctype/student/student.py b/erpnext/education/doctype/student/student.py index 76825cec1b2..68e752b4574 100644 --- a/erpnext/education/doctype/student/student.py +++ b/erpnext/education/doctype/student/student.py @@ -58,7 +58,6 @@ class Student(Document): student_user.flags.ignore_permissions = True student_user.add_roles("Student") student_user.save() - update_password_link = student_user.reset_password() def update_applicant_status(self): """Updates Student Applicant status to Admitted"""