From dbab718aaa76a56cd2b1900b0e781ba90b6666e5 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Tue, 7 Oct 2025 11:18:30 +0530 Subject: [PATCH 1/9] fix(process statement of accounts): allow renaming --- .../process_statement_of_accounts.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json index ea1b61a31d4..a546fc4ff6e 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json @@ -1,5 +1,6 @@ { "actions": [], + "allow_rename": 1, "autoname": "Prompt", "creation": "2020-05-22 16:46:18.712954", "doctype": "DocType", @@ -416,7 +417,7 @@ } ], "links": [], - "modified": "2025-09-03 14:24:43.608565", + "modified": "2025-10-07 11:17:05.444394", "modified_by": "Administrator", "module": "Accounts", "name": "Process Statement Of Accounts", From d610d1dccd80a1e8f657f4b9b975533467b5fc12 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Tue, 7 Oct 2025 12:29:24 +0530 Subject: [PATCH 2/9] feat(process statement of accounts): added more frequency options for auto email --- .../process_statement_of_accounts.json | 4 ++-- .../process_statement_of_accounts.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json index a546fc4ff6e..dd021edd7f2 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json @@ -70,7 +70,7 @@ "fieldname": "frequency", "fieldtype": "Select", "label": "Frequency", - "options": "Weekly\nMonthly\nQuarterly" + "options": "Daily\nWeekly\nBiweekly\nMonthly\nQuarterly" }, { "fieldname": "company", @@ -417,7 +417,7 @@ } ], "links": [], - "modified": "2025-10-07 11:17:05.444394", + "modified": "2025-10-07 12:19:20.719898", "modified_by": "Administrator", "module": "Accounts", "name": "Process Statement Of Accounts", diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py index 96389f67e1e..9cf27216b1e 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py @@ -8,7 +8,7 @@ import frappe from frappe import _ from frappe.desk.reportview import get_match_cond from frappe.model.document import Document -from frappe.utils import add_days, add_months, format_date, getdate, today +from frappe.utils import add_days, add_months, add_to_date, format_date, getdate, today from frappe.utils.jinja import validate_template from frappe.utils.pdf import get_pdf from frappe.www.printview import get_print_style @@ -55,7 +55,7 @@ class ProcessStatementOfAccounts(Document): enable_auto_email: DF.Check filter_duration: DF.Int finance_book: DF.Link | None - frequency: DF.Literal["Weekly", "Monthly", "Quarterly"] + frequency: DF.Literal["Daily", "Weekly", "Biweekly", "Monthly", "Quarterly"] from_date: DF.Date | None ignore_cr_dr_notes: DF.Check ignore_exchange_rate_revaluation_journals: DF.Check @@ -555,8 +555,9 @@ def send_emails(document_name, from_scheduler=False, posting_date=None): if doc.enable_auto_email and from_scheduler: new_to_date = getdate(posting_date or today()) - if doc.frequency == "Weekly": - new_to_date = add_days(new_to_date, 7) + if doc.frequency in ("Daily", "Weekly", "Biweekly"): + frequency = {"Daily": 1, "Weekly": 7, "Biweekly": 14} + new_to_date = add_days(new_to_date, frequency[doc.frequency]) else: new_to_date = add_months(new_to_date, 1 if doc.frequency == "Monthly" else 3) new_from_date = add_months(new_to_date, -1 * doc.filter_duration) From 4a4c2188ec5818c02ee83d34e5f2ef25e450c89a Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Tue, 7 Oct 2025 16:04:23 +0530 Subject: [PATCH 3/9] fix(process statement of accounts): naming of reports --- .../process_statement_of_accounts.html | 2 +- .../process_statement_of_accounts_accounts_receivable.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html index c3603290f47..5aac9d902e1 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html @@ -13,7 +13,7 @@ {% endif %} -

{{ _("STATEMENT OF ACCOUNTS") }}

+

{{ _("GENERAL LEDGER") }}

{% if filters.party[0] == filters.party_name[0] %}
{{ _("Customer: ") }} {{ filters.party_name[0] }}
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html index 441a4b3da43..89ea90f6eb7 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html @@ -23,7 +23,7 @@ {% endif %}
-

{{ _(report.report_name) }}

+

{{ _("STATEMENT OF ACCOUNTS") }}

{{ filters.customer_name }}

From 323d8eaccdb213e12cdbdbde3fe8e8b24323c4ea Mon Sep 17 00:00:00 2001 From: ravibharathi656 Date: Wed, 8 Oct 2025 08:43:42 +0530 Subject: [PATCH 4/9] fix(asset movement): clear custodian if not present --- erpnext/assets/doctype/asset_movement/asset_movement.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/assets/doctype/asset_movement/asset_movement.py b/erpnext/assets/doctype/asset_movement/asset_movement.py index d63492846c9..25a06e463bb 100644 --- a/erpnext/assets/doctype/asset_movement/asset_movement.py +++ b/erpnext/assets/doctype/asset_movement/asset_movement.py @@ -5,7 +5,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import get_link_to_form +from frappe.utils import cstr, get_link_to_form from erpnext.assets.doctype.asset_activity.asset_activity import add_asset_activity @@ -143,8 +143,8 @@ class AssetMovement(Document): def update_asset_location_and_custodian(self, asset_id, location, employee): asset = frappe.get_doc("Asset", asset_id) - if employee and employee != asset.custodian: - frappe.db.set_value("Asset", asset_id, "custodian", employee) + if cstr(employee) != asset.custodian: + frappe.db.set_value("Asset", asset_id, "custodian", cstr(employee)) if location and location != asset.location: frappe.db.set_value("Asset", asset_id, "location", location) From 630d8732143b1273cc1f7ee4f2d350f80a888d27 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 8 Oct 2025 18:27:39 +0530 Subject: [PATCH 5/9] fix: incorrect field valuation_rate --- erpnext/stock/stock_ledger.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index bab68615d30..80d35ad3556 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1074,16 +1074,15 @@ class update_entries_after: for d in sabb_data: incoming_rate = get_incoming_rate_for_serial_and_batch(self.item_code, d, sn_obj) - - if flt(incoming_rate, self.currency_precision) == flt( - d.valuation_rate, self.currency_precision - ) and not getattr(d, "stock_queue", None): - continue - amount = incoming_rate * flt(d.qty) tot_amt += flt(amount) total_qty += flt(d.qty) + if flt(incoming_rate, self.currency_precision) == flt( + d.incoming_rate, self.currency_precision + ) and not getattr(d, "stock_queue", None): + continue + values_to_update = { "incoming_rate": incoming_rate, "stock_value_difference": amount, From ff2faf36a7640cda4a9fe4bfb5b1380752af7f97 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 8 Oct 2025 18:37:40 +0530 Subject: [PATCH 6/9] fix: batch qty for expired batches --- erpnext/stock/doctype/batch/batch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index ad8218cfcfb..7a12844f1c6 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -158,7 +158,7 @@ class Batch(Document): @frappe.whitelist() def recalculate_batch_qty(self): - batches = get_batch_qty(batch_no=self.name, item_code=self.item) + batches = get_batch_qty(batch_no=self.name, item_code=self.item, for_stock_levels=True) batch_qty = 0.0 if batches: for row in batches: From aab6271b140466605f2d61cbf8ce5f64aee01bdd Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 8 Oct 2025 19:06:53 +0530 Subject: [PATCH 7/9] fix: incorrect qty in stock levels --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index 386e89af49b..91bbc6abdcb 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -2337,15 +2337,15 @@ def get_reserved_batches_for_sre(kwargs) -> dict: if kwargs.batch_no: if isinstance(kwargs.batch_no, list): - query = query.where(sb_entry.batch_no.notin(kwargs.batch_no)) + query = query.where(sb_entry.batch_no.isin(kwargs.batch_no)) else: - query = query.where(sb_entry.batch_no != kwargs.batch_no) + query = query.where(sb_entry.batch_no == kwargs.batch_no) if kwargs.warehouse: if isinstance(kwargs.warehouse, list): - query = query.where(sre.warehouse.notin(kwargs.warehouse)) + query = query.where(sre.warehouse.isin(kwargs.warehouse)) else: - query = query.where(sre.warehouse != kwargs.warehouse) + query = query.where(sre.warehouse == kwargs.warehouse) if kwargs.ignore_voucher_nos: query = query.where(sre.name.notin(kwargs.ignore_voucher_nos)) From 128e243945457d36e720ffb4633113fdba172d93 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 8 Oct 2025 21:46:17 +0530 Subject: [PATCH 8/9] fix: Reset Raw Materials Table button not working --- erpnext/controllers/subcontracting_controller.py | 6 ++++++ .../subcontracting_receipt/subcontracting_receipt.js | 4 ++++ .../subcontracting_receipt/subcontracting_receipt.json | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/subcontracting_controller.py b/erpnext/controllers/subcontracting_controller.py index cf3782c7e4b..db42d11ab0a 100644 --- a/erpnext/controllers/subcontracting_controller.py +++ b/erpnext/controllers/subcontracting_controller.py @@ -202,6 +202,9 @@ class SubcontractingController(StockController): self.set(self.raw_material_table, []) return + if not self.get(self.raw_material_table): + return + item_dict = self.__get_data_before_save() if not item_dict: return True @@ -657,6 +660,9 @@ class SubcontractingController(StockController): from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos_for_outward from erpnext.stock.get_item_details import get_filtered_serial_nos + if self.is_return: + return + for row in self.supplied_items: item_details = frappe.get_cached_value( "Item", row.rm_item_code, ["has_batch_no", "has_serial_no"], as_dict=1 diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js index c9fe457ef79..fee1cac2542 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js +++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js @@ -336,6 +336,10 @@ frappe.ui.form.on("Subcontracting Receipt", { reset_raw_materials_table: (frm) => { frm.clear_table("supplied_items"); + frm.doc.__unsaved = true; + if (!frm.doc.set_posting_time) { + frm.set_value("posting_time", frappe.datetime.now_time()); + } frm.call({ method: "reset_raw_materials", diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json index f3a37cc8bb1..79b46ec146a 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json +++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json @@ -649,6 +649,7 @@ "label": "Raw Materials Actions" }, { + "description": "Click this button if you encounter a negative stock error for a serial or batch item. The system will fetch the available serials or batches automatically.", "fieldname": "reset_raw_materials_table", "fieldtype": "Button", "label": "Reset Raw Materials Table" @@ -678,7 +679,7 @@ "in_create": 1, "is_submittable": 1, "links": [], - "modified": "2024-12-06 15:24:38.384232", + "modified": "2025-10-08 21:43:27.065640", "modified_by": "Administrator", "module": "Subcontracting", "name": "Subcontracting Receipt", @@ -739,6 +740,7 @@ "write": 1 } ], + "row_format": "Dynamic", "search_fields": "status, posting_date, supplier", "show_name_in_global_search": 1, "sort_field": "creation", @@ -747,4 +749,4 @@ "timeline_field": "supplier", "title_field": "title", "track_changes": 1 -} \ No newline at end of file +} From 946073cfd93c654b075e23798a325667eafc486e Mon Sep 17 00:00:00 2001 From: Jaswanth Sriram Date: Thu, 2 Oct 2025 14:13:45 +0530 Subject: [PATCH 9/9] perf: avoid unnecessary set_dynamic_labels updates --- erpnext/public/js/controllers/transaction.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 32c5451b6f7..7b41afcb621 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1679,6 +1679,17 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe ); var company_currency = this.get_company_currency(); + + if ( + this._last_company_currency === company_currency && + this._last_price_list_currency === this.frm.doc.price_list_currency + ) { + return; + } + + this._last_company_currency = company_currency; + this._last_price_list_currency = this.frm.doc.price_list_currency; + this.change_form_labels(company_currency); this.change_grid_labels(company_currency); this.frm.refresh_fields();