From 13d5eec194ae8cc0110bbaaccf310f29f3900e20 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 31 Oct 2023 19:55:56 +0530 Subject: [PATCH 1/6] fix: bump pygithub requirement to handle conflict (#37800) build: bump pygithub requirement This conflicts with pyjwt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4098462cd3b..2f5b88a6681 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ googlemaps # used in ERPNext, but dependency is defined in Frappe pandas>=1.1.5,<2.0.0 plaid-python~=7.2.1 pycountry~=20.7.3 -PyGithub~=1.54.1 +PyGithub~=2.1.1 python-stdnum~=1.16 python-youtube~=0.8.0 taxjar~=1.9.2 From 8f4ded6ad1f7d5145d5b4ed33a049b4a4a4c16b6 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Wed, 1 Nov 2023 13:27:24 +0530 Subject: [PATCH 2/6] fix: e-invoice jwt verification error (#37818) --- erpnext/regional/india/e_invoice/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py index 251404a46a1..27e3da72036 100644 --- a/erpnext/regional/india/e_invoice/utils.py +++ b/erpnext/regional/india/e_invoice/utils.py @@ -1378,7 +1378,7 @@ class GSPConnector: def set_einvoice_data(self, res): enc_signed_invoice = res.get("SignedInvoice") - dec_signed_invoice = jwt.decode(enc_signed_invoice, verify=False)["data"] + dec_signed_invoice = jwt.decode(enc_signed_invoice, options={"verify_signature": False})["data"] self.invoice.irn = res.get("Irn") self.invoice.ewaybill = res.get("EwbNo") From 6952f0f0827ec423050401c4f1262b359099a342 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:26:45 +0530 Subject: [PATCH 3/6] fix: permission error while creating Supplier Quotation from Portal (backport #37864) (#37872) * fix: permission error while creating Supplier Quotation from Portal (cherry picked from commit e019d43d0b3fa6faa241a7b9885f65f6fccc9459) # Conflicts: # erpnext/controllers/buying_controller.py * chore: `conflicts` --------- Co-authored-by: s-aga-r --- erpnext/controllers/buying_controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 4156570ebb0..8f16343062d 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -4,7 +4,7 @@ import frappe from frappe import ValidationError, _, msgprint -from frappe.contacts.doctype.address.address import get_address_display +from frappe.contacts.doctype.address.address import render_address from frappe.utils import cint, cstr, flt, getdate from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget @@ -187,7 +187,9 @@ class BuyingController(StockController, Subcontracting): for address_field, address_display_field in address_dict.items(): if self.get(address_field): - self.set(address_display_field, get_address_display(self.get(address_field))) + self.set( + address_display_field, render_address(self.get(address_field), check_permissions=False) + ) def set_total_in_words(self): from frappe.utils import money_in_words From 37b1a0e778e972d131f39f062cdd6b32282e0658 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Fri, 3 Nov 2023 20:57:52 +0530 Subject: [PATCH 4/6] fix: add missing disbursement account in update_old_loans patch (cherry picked from commit ad64065ec6d0b6606c37843dd4ce41a96dc8e969) --- erpnext/patches/v13_0/update_old_loans.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/patches/v13_0/update_old_loans.py b/erpnext/patches/v13_0/update_old_loans.py index 0bd3fcdec4c..30db996e736 100644 --- a/erpnext/patches/v13_0/update_old_loans.py +++ b/erpnext/patches/v13_0/update_old_loans.py @@ -125,6 +125,7 @@ def execute(): loan_type_doc.company = loan.company loan_type_doc.mode_of_payment = loan.mode_of_payment loan_type_doc.payment_account = loan.payment_account + loan_type_doc.disbursement_account = loan.payment_account loan_type_doc.loan_account = loan.loan_account loan_type_doc.interest_income_account = loan.interest_income_account loan_type_doc.penalty_income_account = penalty_account From 4789ecacea020a807f13d112d1e327e78af8772d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 5 Nov 2023 06:22:42 +0000 Subject: [PATCH 5/6] fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport #37499) (#37918) fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (#37499) * fix: account for case-insensitive database primary key for parameter names * chore: linting (cherry picked from commit b099590b2c1dcd041b833af50e99eb3e7988c595) Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com> --- .../convert_qi_parameter_to_link_field.py | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py index efbb96c100a..e53bdf8f19e 100644 --- a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py +++ b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py @@ -3,23 +3,24 @@ import frappe def execute(): frappe.reload_doc("stock", "doctype", "quality_inspection_parameter") + params = set() - # get all distinct parameters from QI readigs table - reading_params = frappe.db.get_all( - "Quality Inspection Reading", fields=["distinct specification"] - ) - reading_params = [d.specification for d in reading_params] + # get all parameters from QI readings table + for (p,) in frappe.db.get_all( + "Quality Inspection Reading", fields=["specification"], as_list=True + ): + params.add(p.strip()) - # get all distinct parameters from QI Template as some may be unused in QI - template_params = frappe.db.get_all( - "Item Quality Inspection Parameter", fields=["distinct specification"] - ) - template_params = [d.specification for d in template_params] + # get all parameters from QI Template as some may be unused in QI + for (p,) in frappe.db.get_all( + "Item Quality Inspection Parameter", fields=["specification"], as_list=True + ): + params.add(p.strip()) - params = list(set(reading_params + template_params)) + # because db primary keys are case insensitive, so duplicates will cause an exception + params = set({x.casefold(): x for x in params}.values()) for parameter in params: - if not frappe.db.exists("Quality Inspection Parameter", parameter): - frappe.get_doc( - {"doctype": "Quality Inspection Parameter", "parameter": parameter, "description": parameter} - ).insert(ignore_permissions=True) + frappe.get_doc( + {"doctype": "Quality Inspection Parameter", "parameter": parameter, "description": parameter} + ).insert(ignore_permissions=True) From 8cb0f690d5f39b29bae3692822c6ac1d5eaa5b30 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 16:07:17 +0530 Subject: [PATCH 6/6] fix: remove voucher type and no for Item and Warehouse based reposting (backport #37849) (backport #37850) (#37938) * fix: remove voucher type and no for Item and Warehouse based reposting (backport #37849) (#37850) * fix: remove voucher type and no for Item and Warehouse based reposting (cherry picked from commit 0104897d693ca98796536eac7a9edadc58c64fff) * chore: fix test cases --------- Co-authored-by: Rohit Waghchaure (cherry picked from commit e19cade12d59ec439e2e1141e929c4d846935013) # Conflicts: # erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py # erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py # erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json * chore: fix conflicts * chore: fix conflicts * chore: fix conflicts * fix: conflicts --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: rohitwaghchaure --- erpnext/controllers/stock_controller.py | 2 -- .../repost_item_valuation/test_repost_item_valuation.py | 4 +++- erpnext/stock/doctype/stock_entry/test_stock_entry.py | 1 + .../stock_reposting_settings/stock_reposting_settings.json | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index c866f6d3727..450d3a279b1 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -914,8 +914,6 @@ def create_item_wise_repost_entries(voucher_type, voucher_no, allow_zero_rate=Fa repost_entry = frappe.new_doc("Repost Item Valuation") repost_entry.based_on = "Item and Warehouse" - repost_entry.voucher_type = voucher_type - repost_entry.voucher_no = voucher_no repost_entry.item_code = sle.item_code repost_entry.warehouse = sle.warehouse diff --git a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py index 78d6417bfa8..78c928d607c 100644 --- a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py @@ -5,7 +5,7 @@ from unittest.mock import MagicMock, call import frappe -from frappe.tests.utils import FrappeTestCase +from frappe.tests.utils import FrappeTestCase, change_settings from frappe.utils import nowdate from frappe.utils.data import add_to_date, today @@ -173,6 +173,7 @@ class TestRepostItemValuation(FrappeTestCase, StockTestMixin): riv.set_status("Skipped") + @change_settings("Stock Reposting Settings", {"item_based_reposting": 0}) def test_prevention_of_cancelled_transaction_riv(self): frappe.flags.dont_execute_stock_reposts = True @@ -295,6 +296,7 @@ class TestRepostItemValuation(FrappeTestCase, StockTestMixin): accounts_settings.acc_frozen_upto = "" accounts_settings.save() + @change_settings("Stock Reposting Settings", {"item_based_reposting": 0}) def test_create_repost_entry_for_cancelled_document(self): pr = make_purchase_receipt( company="_Test Company with perpetual inventory", diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 99de4c1844f..7203c482f96 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -1414,6 +1414,7 @@ class TestStockEntry(FrappeTestCase): self.assertEqual(se.items[0].item_name, item.item_name) self.assertEqual(se.items[0].stock_uom, item.stock_uom) + @change_settings("Stock Reposting Settings", {"item_based_reposting": 0}) def test_reposting_for_depedent_warehouse(self): from erpnext.stock.doctype.repost_item_valuation.repost_item_valuation import repost_sl_entries from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse diff --git a/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json b/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json index 0facae8d3b8..a3abf9518bc 100644 --- a/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json +++ b/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json @@ -48,7 +48,7 @@ "label": "Limit timeslot for Stock Reposting" }, { - "default": "0", + "default": "1", "fieldname": "item_based_reposting", "fieldtype": "Check", "label": "Use Item based reposting" @@ -57,7 +57,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2021-11-02 01:22:45.155841", + "modified": "2023-11-01 16:14:29.080697", "modified_by": "Administrator", "module": "Stock", "name": "Stock Reposting Settings", @@ -77,4 +77,4 @@ "sort_field": "modified", "sort_order": "DESC", "track_changes": 1 -} \ No newline at end of file +}