Skip to content

Conversation

@PugazhendhiVelu
Copy link
Contributor

Issue :

When a normal user tries to access Production Plan Summary report, a permission error occurs because the Document Type column is defined as a Link field pointing to the DocType doctype.

Since only users with the System Manager role or Administrator user have read access to the DocType doctype, other users are unable to load the report.

Ref : #51054

Backport needed: v15

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Nov 10, 2025
@Vigneshsekar Vigneshsekar marked this pull request as ready for review November 10, 2025 15:38
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

📝 Walkthrough

Walkthrough

The Document Type column in the production_plan_summary report was changed from a Link field type (referencing the DocType document type) to a plain Data field type. This modification removes the hyperlink behavior and associated DocType-specific options from the column, converting it to display as plain text in the report output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file modification with a focused field type change
  • Verify the rationale for converting from Link to Data field type
  • Confirm that the report rendering remains functional with the plain text field
  • Check for any dependent code or references that relied on the Link field's clickable behavior or DocType-specific properties

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Title check ✅ Passed The title accurately summarizes the main change: converting the Document Type column fieldtype from link to data in the production plan summary report.
Description check ✅ Passed The description clearly explains the issue (permission error for non-admin users), the root cause (Link field to DocType), and the solution, directly relating to the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc351fe and 462deb3.

📒 Files selected for processing (1)
  • erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py (1 hunks)
⏰ 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). (1)
  • GitHub Check: Summary
🔇 Additional comments (1)
erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py (1)

163-166: Fix correctly removes permission barrier while maintaining functionality.

Changing document_type from Link to Data properly resolves the DocType read permission requirement. The hardcoded string values ("Work Order" and "Purchase Order" at lines 59 and 110) work seamlessly with the Dynamic Link field at lines 169–172, which reads these strings to determine the link target.

Recommended verification:

  • Confirm normal users (non-System Manager) can load the report without permission errors
  • Verify the Dynamic Link navigation in the "Document Name" column functions correctly

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.

@mihir-kandoi mihir-kandoi merged commit 834221b into frappe:develop Nov 11, 2025
14 checks passed
mihir-kandoi added a commit that referenced this pull request Nov 11, 2025
@mihir-kandoi mihir-kandoi self-assigned this Nov 11, 2025
frappe-pr-bot pushed a commit that referenced this pull request Nov 11, 2025
# [15.88.0](v15.87.2...v15.88.0) (2025-11-11)

### Bug Fixes

* add company filter for default warehouse for sales return ([32d3fbf](32d3fbf))
* add is_group filter in task for timesheet ([0f00581](0f00581))
* add missing stock entry UOM filtering based on item master ([#50135](#50135)) ([8f2002d](8f2002d))
* add validation to reject empty readings ([ac0375f](ac0375f))
* apply company,is_group filter for cost center ([b181686](b181686))
* automatically append taxes if taxes_and_charges is set in Buying controller ([25f5fb7](25f5fb7))
* **buying:** fetch Cost Center from Project ([e8e26a9](e8e26a9))
* change fieldtype from link to data for document_type in producti… (backport [#50443](#50443)) ([#50455](#50455)) ([a3ddc95](a3ddc95))
* change fieldtype from link to data for document_type in production plan summary ([9012a72](9012a72))
* check warehouse account before accessing ([79b3af6](79b3af6))
* ensure that additional discount amount is not mapped repeatedly ([44539f0](44539f0))
* handle partial dn against reserved stock ([9d979e3](9d979e3))
* handle returns as well ([9ed40cc](9ed40cc))
* hide total row in general ledger report ([56bb88d](56bb88d))
* ignore Department doctype ([32182d7](32182d7))
* include cost_center and project upon accounting dimension fetch ([3f490f1](3f490f1))
* material request item quantity validation against sales order with over-receipt allowance ([f2fef54](f2fef54))
* **material request:** set default buying price list if not exists ([670c6dc](670c6dc))
* Nonetype error if reserved stock is not present ([b8ec3ae](b8ec3ae))
* Pass stock_qty and picked_qty in transfer entry ([95ea9ca](95ea9ca))
* removed the validation ([080e9a3](080e9a3))
* reset billing and shipping address when company changes ([73b8a29](73b8a29))
* resolve conflict ([7d593dd](7d593dd))
* set company before creating asset movement to avoid permission error ([3fad90e](3fad90e))
* show only stock items in delivered items to be billed and received items to be billed reports ([3dbc90a](3dbc90a))
* state_to_state_province for translation ([#50244](#50244)) ([d4f6ca3](d4f6ca3))
* **stock:** ignore current voucher in reserved stock validation ([0e7f971](0e7f971))
* **Timesheet:** don't use billing_hours for costing amount ([#50394](#50394)) ([29c976e](29c976e))
* trends report total mismatch with group filters ([7e3f30b](7e3f30b))
* Update pick list locations quantity ([ce7ab8d](ce7ab8d))
* update uom when item changes ([2a2ae9a](2a2ae9a))
* validate is_group for parent task ([3380dea](3380dea))
* validate that discount amount cannot exceed total before discount ([e559faf](e559faf))

### Features

* **account settings:** add checkbox to show balances in payment entry ([90500f0](90500f0))
* add asset name column ([c486471](c486471))
* make material transfer warehouse validation optional (backport [#50461](#50461)) ([#50462](#50462)) ([1747e83](1747e83))
* process period closing voucher ([c8e3da0](c8e3da0))

### Performance Improvements

* serial no creation ([6ba2491](6ba2491))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport version-15-hotfix needs-tests This PR needs automated unit-tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants