From 42c2b84b289a6586f4977d9d35eaa2282e83b59a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:49:21 +0100 Subject: [PATCH 1/5] feat: remove Payroll Entry from Bank Account dashboard (backport #43931) (#43932) Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> --- erpnext/accounts/doctype/bank_account/bank_account.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/bank_account/bank_account.json b/erpnext/accounts/doctype/bank_account/bank_account.json index a5a7691eb76..962551b2417 100644 --- a/erpnext/accounts/doctype/bank_account/bank_account.json +++ b/erpnext/accounts/doctype/bank_account/bank_account.json @@ -224,11 +224,6 @@ "link_doctype": "Bank Guarantee", "link_fieldname": "bank_account" }, - { - "group": "Transactions", - "link_doctype": "Payroll Entry", - "link_fieldname": "bank_account" - }, { "group": "Transactions", "link_doctype": "Bank Transaction", @@ -255,7 +250,7 @@ "link_fieldname": "default_bank_account" } ], - "modified": "2024-09-24 06:57:41.292970", + "modified": "2024-10-30 09:41:14.113414", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Account", From 4f8a8a5e9901e3a3b8f24d195f1354e833648e3e Mon Sep 17 00:00:00 2001 From: CaseSolved Date: Wed, 25 Sep 2024 19:09:05 +0100 Subject: [PATCH 2/5] fix: SO link on PO and add in missing dashboard references on both (cherry picked from commit 2017fd80d1bf930fd5185ddb3ddb427eb73841f8) # Conflicts: # erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py # erpnext/selling/doctype/sales_order/sales_order_dashboard.py --- .../purchase_order_dashboard.py | 27 ++++++++++++++++--- .../sales_order/sales_order_dashboard.py | 7 +++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index 05b5a8e7b8c..80b2bec2a59 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -14,15 +14,36 @@ def get_data(): "Material Request": ["items", "material_request"], "Supplier Quotation": ["items", "supplier_quotation"], "Project": ["items", "project"], + "Sales Order": ["items", "sales_order"], + "BOM": ["items", "bom"], + "Production Plan": ["items", "production_plan"], + "Blanket Order": ["items", "blanket_order"], }, "transactions": [ - {"label": _("Related"), "items": ["Purchase Receipt", "Purchase Invoice"]}, - {"label": _("Payment"), "items": ["Payment Entry", "Journal Entry", "Payment Request"]}, + { + "label": _("Related"), + "items": ["Purchase Receipt", "Purchase Invoice", "Sales Order"] + }, + { + "label": _("Payment"), + "items": ["Payment Entry", "Journal Entry", "Payment Request"] + }, { "label": _("Reference"), - "items": ["Material Request", "Supplier Quotation", "Project", "Auto Repeat"], + "items": ["Supplier Quotation", "Project", "Auto Repeat"], }, + { + "label": _("Manufacturing"), + "items": ["Material Request", "BOM", "Production Plan", "Blanket Order"], + }, +<<<<<<< HEAD {"label": _("Sub-contracting"), "items": ["Subcontracting Order", "Stock Entry"]}, {"label": _("Internal"), "items": ["Sales Order"]}, +======= + { + "label": _("Sub-contracting"), + "items": ["Subcontracting Order", "Subcontracting Receipt", "Stock Entry"], + }, +>>>>>>> 2017fd80d1 (fix: SO link on PO and add in missing dashboard references on both) ], } diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py index cbc40bbf90b..18eed5d8096 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py +++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py @@ -14,6 +14,8 @@ def get_data(): }, "internal_links": { "Quotation": ["items", "prevdoc_docname"], + "BOM": ["items", "bom_no"], + "Blanket Order": ["items", "blanket_order"], }, "transactions": [ { @@ -22,8 +24,13 @@ def get_data(): }, {"label": _("Purchasing"), "items": ["Material Request", "Purchase Order"]}, {"label": _("Projects"), "items": ["Project"]}, +<<<<<<< HEAD {"label": _("Manufacturing"), "items": ["Work Order"]}, {"label": _("Reference"), "items": ["Quotation", "Auto Repeat"]}, +======= + {"label": _("Manufacturing"), "items": ["Work Order", "BOM", "Blanket Order"]}, + {"label": _("Reference"), "items": ["Quotation", "Auto Repeat", "Stock Reservation Entry"]}, +>>>>>>> 2017fd80d1 (fix: SO link on PO and add in missing dashboard references on both) {"label": _("Payment"), "items": ["Payment Entry", "Payment Request", "Journal Entry"]}, ], } From 7906c21bdff2ba2424ac741166d5dde8b79e396f Mon Sep 17 00:00:00 2001 From: CaseSolved Date: Wed, 25 Sep 2024 19:27:21 +0100 Subject: [PATCH 3/5] chore: linting (cherry picked from commit be6970c850d3c81f1b32ae00ede2e49c588ab2e9) --- .../doctype/purchase_order/purchase_order_dashboard.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index 80b2bec2a59..eba11068055 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -20,14 +20,8 @@ def get_data(): "Blanket Order": ["items", "blanket_order"], }, "transactions": [ - { - "label": _("Related"), - "items": ["Purchase Receipt", "Purchase Invoice", "Sales Order"] - }, - { - "label": _("Payment"), - "items": ["Payment Entry", "Journal Entry", "Payment Request"] - }, + {"label": _("Related"), "items": ["Purchase Receipt", "Purchase Invoice", "Sales Order"]}, + {"label": _("Payment"), "items": ["Payment Entry", "Journal Entry", "Payment Request"]}, { "label": _("Reference"), "items": ["Supplier Quotation", "Project", "Auto Repeat"], From 0f4c5dd26cff47c2a6387a5b349d27566daf27f2 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 4 Nov 2024 14:14:49 +0530 Subject: [PATCH 4/5] chore: resolve conflicts Stock Reservation Entry is unavailable in v14 --- .../doctype/purchase_order/purchase_order_dashboard.py | 6 +----- .../selling/doctype/sales_order/sales_order_dashboard.py | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index eba11068055..958d277bb84 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -30,14 +30,10 @@ def get_data(): "label": _("Manufacturing"), "items": ["Material Request", "BOM", "Production Plan", "Blanket Order"], }, -<<<<<<< HEAD - {"label": _("Sub-contracting"), "items": ["Subcontracting Order", "Stock Entry"]}, - {"label": _("Internal"), "items": ["Sales Order"]}, -======= { "label": _("Sub-contracting"), "items": ["Subcontracting Order", "Subcontracting Receipt", "Stock Entry"], }, ->>>>>>> 2017fd80d1 (fix: SO link on PO and add in missing dashboard references on both) + {"label": _("Internal"), "items": ["Sales Order"]}, ], } diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py index 18eed5d8096..03701745c56 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py +++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py @@ -24,13 +24,8 @@ def get_data(): }, {"label": _("Purchasing"), "items": ["Material Request", "Purchase Order"]}, {"label": _("Projects"), "items": ["Project"]}, -<<<<<<< HEAD - {"label": _("Manufacturing"), "items": ["Work Order"]}, {"label": _("Reference"), "items": ["Quotation", "Auto Repeat"]}, -======= {"label": _("Manufacturing"), "items": ["Work Order", "BOM", "Blanket Order"]}, - {"label": _("Reference"), "items": ["Quotation", "Auto Repeat", "Stock Reservation Entry"]}, ->>>>>>> 2017fd80d1 (fix: SO link on PO and add in missing dashboard references on both) {"label": _("Payment"), "items": ["Payment Entry", "Payment Request", "Journal Entry"]}, ], } From 57d35ec20e1cba9795ccb4a0849cc83a61bdfd83 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 10:05:36 +0530 Subject: [PATCH 5/5] perf: too many writes error during reposting (backport #43978) (#43982) perf: too many writes error during reposting (#43978) perf: too many writes error (cherry picked from commit 134c24b9c5218161c239be39aaeec55d06028ea9) Co-authored-by: rohitwaghchaure --- erpnext/stock/stock_ledger.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index a81b57168de..ba2f65dccbc 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -742,7 +742,7 @@ class update_entries_after: rate = 0 # Material Transfer, Repack, Manufacturing if sle.voucher_type == "Stock Entry": - self.recalculate_amounts_in_stock_entry(sle.voucher_no) + self.recalculate_amounts_in_stock_entry(sle.voucher_no, sle.voucher_detail_no) rate = frappe.db.get_value("Stock Entry Detail", sle.voucher_detail_no, "valuation_rate") # Sales and Purchase Return elif sle.voucher_type in ( @@ -853,14 +853,15 @@ class update_entries_after: # Update outgoing item's rate, recalculate FG Item's rate and total incoming/outgoing amount if not sle.dependant_sle_voucher_detail_no: - self.recalculate_amounts_in_stock_entry(sle.voucher_no) + self.recalculate_amounts_in_stock_entry(sle.voucher_no, sle.voucher_detail_no) - def recalculate_amounts_in_stock_entry(self, voucher_no): + def recalculate_amounts_in_stock_entry(self, voucher_no, voucher_detail_no): stock_entry = frappe.get_doc("Stock Entry", voucher_no, for_update=True) stock_entry.calculate_rate_and_amount(reset_outgoing_rate=False, raise_error_if_no_rate=False) stock_entry.db_update() for d in stock_entry.items: - d.db_update() + if d.name == voucher_detail_no or (not d.s_warehouse and d.t_warehouse): + d.db_update() def update_rate_on_delivery_and_sales_return(self, sle, outgoing_rate): # Update item's incoming rate on transaction