Skip to content

Conversation

@Gubbu77
Copy link
Contributor

@Gubbu77 Gubbu77 commented Dec 31, 2025

Exclude cancelled repost accounting ledgers in _remove_references_in_repost_doctypes, due to this cannot delete the invoices.

repost_doc.save() - saving cancelled document!!

Summary by CodeRabbit

  • Chores

    • Released version 15.93.1
  • Bug Fixes

    • Enhanced reconciliation processes to exclude cancelled documents from reprocessing, ensuring only active records are affected by account updates.

✏️ Tip: You can customize this high-level summary in your review settings.

mihir-kandoi and others added 5 commits December 23, 2025 22:10
# [15.93.0](frappe/erpnext@v15.92.5...v15.93.0) (2025-12-23)

### Bug Fixes

* added limit ([73643de](frappe@73643de))
* **buying:** add disabled filter for supplier ([0b6b73b](frappe@0b6b73b))
* cascade projected quantity across multiple items in material requests ([dffd5d9](frappe@dffd5d9))
* de-duplicate rows on disassembly with multiple manufacture entries ([68eeba4](frappe@68eeba4))
* do not hide primary-action for composite asset ([cbcfe6e](frappe@cbcfe6e))
* don't fetch qty as it's unused ([dd19b95](frappe@dd19b95))
* incorrect current qty in stock reco (backport [frappe#51152](frappe#51152)) ([frappe#51158](frappe#51158)) ([89d6a8f](frappe@89d6a8f))
* limit condition to fetch serial nos ([425dcee](frappe@425dcee))
* **manufacturing:** validate delivered qty in production plan ([c01f20d](frappe@c01f20d))
* **payment entry:** set row id for 'On Previous Row Amount' or 'On Previous Row Total' charge type on tax table ([d7c50cf](frappe@d7c50cf))
* **pegged currencies:** skip adding currencies_to_add items on  pegged_currency_item if source_currency or pegged_against currency doc does not exist (backport [frappe#51188](frappe#51188)) ([frappe#51203](frappe#51203)) ([8ef09c0](frappe@8ef09c0))
* same serial number was picked in multiple sales invoices ([dc5faa8](frappe@dc5faa8))
* show company currency in asset depreciation schedule ([5b1795b](frappe@5b1795b))
* **stock-report:** ignore reserved stock in batch qty calculation ([26a36d8](frappe@26a36d8))
* **stock:** handle serial and batch nos for disassemble stock entry ([59aef4f](frappe@59aef4f))
* **stock:** ignore reserved stock while calculating batch qty ([ac2402d](frappe@ac2402d))
* support disassemble of RMs other than in BOM ([72d77a5](frappe@72d77a5))
* update batch_qty using get_batch_qty ([ca835c8](frappe@ca835c8))
* use get_batch_qty to fetch batch data ([10b0da8](frappe@10b0da8))
* use original logic for v15 - inverted wrt v16 ([0452b22](frappe@0452b22))
* use serial and batch bundle to fetch incoming rate (backport [frappe#51119](frappe#51119)) ([frappe#51146](frappe#51146)) ([2d42904](frappe@2d42904))
* use stock adjustment if the account has not set ([8a01a70](frappe@8a01a70))

### Features

* add redirect button on report ([fe80d1d](frappe@fe80d1d))
* **report:** add batch qty update functionality in report ([57c356a](frappe@57c356a))

### Performance Improvements

* optimize company monthly sales query using date range ([frappe#48942](frappe#48942)) ([0488658](frappe@0488658))
## [15.93.1](frappe/erpnext@v15.93.0...v15.93.1) (2025-12-30)

### Bug Fixes

* **accounts-payable-summary:** add Show GL Balance check similar to A… (backport [frappe#50802](frappe#50802)) ([frappe#50805](frappe#50805)) ([a04f560](frappe@a04f560))
* **bank reconciliation tool:** carry bank account to payment entry ([cd930c0](frappe@cd930c0))
* **bank reconciliation tool:** fix incorrect bank account field mapping ([9ef0e8b](frappe@9ef0e8b))
* expense_account query override in Purchase Receipt ([6f3904a](frappe@6f3904a))
* **payment entry:** clear party_name for internal transfer ([431e687](frappe@431e687))
* prevent reuse of serial no in manufacture and repack entry ([24f6f1e](frappe@24f6f1e))
* **repost accounting ledger:** prevent preview generation when no vouchers are selected ([93c1a3f](frappe@93c1a3f))
* start reposting accounting ledger after commit ([e6acdf3](frappe@e6acdf3))
* **stock:** remove total bar in chart view ([d9888d5](frappe@d9888d5))
* updating base amounts through python for timesheet for v15 ([9d2e0f6](frappe@9d2e0f6))
* validate depreciation row values ([2f10b9c](frappe@2f10b9c))
* validate party's existing transaction currency before merging ([1c40a61](frappe@1c40a61))

### Performance Improvements

* composite index for serial no ([507a561](frappe@507a561))
* index for warehouse field ([4753594](frappe@4753594))
…ferences

Exclude cancelled repost accounting ledgers in  _remove_references_in_repost_doctypes, due to this cannot delete the invoices.

repost_doc.save() - saving cancelled document!!
@github-actions github-actions bot added accounts needs-tests This PR needs automated unit-tests. labels Dec 31, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

Walkthrough

This pull request includes a version bump and a refinement to document reference handling. The version number in the main module is incremented from 15.92.5 to 15.93.1. Additionally, a filtering criterion is added to the reference removal logic in the accounts controller to exclude cancelled documents (docstatus 2) from processing, narrowing the scope of documents considered in the reference handling workflow.

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and specifically describes the main change: excluding cancelled repost accounting ledgers in the removal of references, which aligns with the core fix implemented in accounts_controller.py.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5955b69 and 7b209e9.

📒 Files selected for processing (2)
  • erpnext/__init__.py
  • erpnext/controllers/accounts_controller.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-16T05:33:58.723Z
Learnt from: Abdeali099
Repo: frappe/erpnext PR: 51078
File: erpnext/accounts/doctype/financial_report_template/financial_report_engine.py:486-491
Timestamp: 2025-12-16T05:33:58.723Z
Learning: In ERPNext/Frappe codebase, query.run(as_dict=True) returns frappe._dict objects that support both dict-style access (obj["key"]) and attribute-style access (obj.key). Therefore, attribute access on query results is valid and will not raise AttributeError. When reviewing Python code, prefer attribute access (obj.key) for readability where the key is known to exist, but ensure existence checks or fallback handling if there is any doubt about missing keys.

Applied to files:

  • erpnext/__init__.py
  • erpnext/controllers/accounts_controller.py
🧬 Code graph analysis (1)
erpnext/controllers/accounts_controller.py (4)
erpnext/stock/doctype/stock_entry/stock_entry.js (1)
  • dt (781-781)
erpnext/public/js/controllers/transaction.js (1)
  • doctype (2736-2736)
erpnext/selling/page/point_of_sale/pos_controller.js (1)
  • name (562-562)
erpnext/selling/page/point_of_sale/pos_payment.js (1)
  • docstatus (599-599)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Python Unit Tests (1)
  • GitHub Check: Python Unit Tests (4)
  • GitHub Check: Python Unit Tests (2)
  • GitHub Check: Python Unit Tests (3)
  • GitHub Check: Patch Test
  • GitHub Check: Summary
🔇 Additional comments (2)
erpnext/__init__.py (1)

7-7: LGTM! Version bump for release 15.93.1.

The version number update is consistent with the PR objectives and follows proper versioning conventions.

erpnext/controllers/accounts_controller.py (1)

429-434: LGTM! The filter correctly prevents processing cancelled repost documents.

The addition of & (dt.docstatus != 2) ensures that only non-cancelled repost entries are retrieved for reference removal. This prevents the failure when repost_doc.save() attempted to modify a cancelled document during invoice deletion.

The fix is consistent with the earlier validation (lines 412-427) that checks for cancelled entries and is a prudent safeguard to ensure that subsequent processing only handles valid, non-cancelled documents.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ruthra-kumar ruthra-kumar self-assigned this Jan 6, 2026
@ruthra-kumar
Copy link
Member

@Gubbu77

Cancelled repost documents are identified only to throw validation error. Not to modify them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accounts needs-tests This PR needs automated unit-tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants