Skip to content

feat: make Shipping Rule Cost Center optional with company default fallback (backport #57355)#57402

Open
mergify[bot] wants to merge 1 commit into
version-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-57355
Open

feat: make Shipping Rule Cost Center optional with company default fallback (backport #57355)#57402
mergify[bot] wants to merge 1 commit into
version-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-57355

Conversation

@mergify

@mergify mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

Cost Center on the Shipping Rule was mandatory, so teams that do not track a cost center on shipping charges were still forced to pick one.

Change

Cost Center on the Shipping Rule is now optional. When it is left blank, the shipping charge added to the taxes table falls back to the company's default cost center. This avoids the "Cost Center is required for Profit and Loss account" error on submit, since shipping accounts are usually income accounts. The rule's Project is now applied to the shipping tax row as well (the field existed but was never being used).

How to test

  1. Open a Shipping Rule, clear the Cost Center, and save.
  2. Add that rule to a Sales Order or Sales Invoice. The shipping tax row should pick up the company default cost center.
  3. Submit. It should post without a missing cost center error.
    no-docs
    This is an automatic backport of pull request feat: make Shipping Rule Cost Center optional with company default fallback #57355 done by Mergify.

…llback (#57355)

feat(shipping-rule): make cost center optional with company default fallback

Cost Center on Shipping Rule is no longer mandatory. When left blank, the
applied shipping tax row falls back to the company default cost center,
avoiding the 'Cost Center is required for Profit and Loss account' error on
submit. The rule's project is also applied to the tax row.

(cherry picked from commit a47f258)

# Conflicts:
#	erpnext/accounts/doctype/shipping_rule/shipping_rule.json
@mergify
mergify Bot requested a review from ruthra-kumar as a code owner July 23, 2026 10:13
@mergify mergify Bot added the conflicts label Jul 23, 2026
@mergify

mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of a47f258 has failed:

On branch mergify/bp/version-15-hotfix/pr-57355
Your branch is up to date with 'origin/version-15-hotfix'.

You are currently cherry-picking commit a47f25896b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   erpnext/accounts/doctype/shipping_rule/shipping_rule.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/shipping_rule/shipping_rule.json

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions Bot added the needs-tests This PR needs automated unit-tests. label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant