Commit Graph

55800 Commits

Author SHA1 Message Date
ruthra kumar
df8edcdc91 Merge pull request #57830 from aerele/backport-57140-v15
fix: clear deferred revenue/expense fields on uncheck (backport #57140)
2026-08-10 15:04:11 +05:30
Pandiyan P
d510978a44 fix: re-check future sle before queuing repost on submit (#57664) (#57960)
* test: cover both repost branches and the no-repost case

* fix: queue repost for entries backdated by a concurrent submit

---------


(cherry picked from commit 399ff463cc)

Co-authored-by: nareshkannasln <nareshkannashanmugam@gmail.com>
2026-08-10 14:03:41 +05:30
mergify[bot]
f9a09f0ac4 fix: skip incoming rate calc when serial no qty is zero (backport #57427) (#57956)
fix: skip incoming rate calc when serial no qty is zero (#57427)

(cherry picked from commit a25decfa50)

Co-authored-by: Shllokkk <140623894+Shllokkk@users.noreply.github.com>
2026-08-10 06:48:58 +00:00
Khushi Rawat
a2b2f5173e Merge pull request #57823 from Shllokkk/asset-repair-downtime-recalc-v15
fix: keep asset repair downtime in sync with entered dates
2026-08-10 12:05:01 +05:30
mergify[bot]
2ca71f16c4 fix: escape customer_details on lead creation from appointment (backport #57947) (#57948)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-08-09 19:30:11 +00:00
Shllokkk
ae18d13e6e Merge pull request #57928 from Shllokkk/sales-register-ledger-pos-paid-v15
fix: reflect in-invoice receivable credits in Sales Register ledger view
2026-08-09 23:39:00 +05:30
Shllokkk
7edb95628c test: cover POS-paid invoice in Sales Register ledger view 2026-08-09 20:22:31 +05:30
Shllokkk
91afc04d9f fix: reflect in-invoice receivable settlements in Sales Register ledger view 2026-08-09 20:22:31 +05:30
Mihir Kandoi
3c5b2ededf Merge pull request #57920 from frappe/mergify/bp/version-15-hotfix/pr-57918
fix: sync open reference forms after Quality Inspection submit (backport #57918)
2026-08-09 16:38:01 +05:30
Mihir Kandoi
94d1dfdcb4 chore: resolve conflict 2026-08-09 16:18:49 +05:30
Mihir Kandoi
2270b22400 test: doc_update published for reference on Quality Inspection submit
(cherry picked from commit e8a6884d5e)

# Conflicts:
#	erpnext/stock/doctype/quality_inspection/test_quality_inspection.py
2026-08-09 10:39:05 +00:00
Mihir Kandoi
c1d198d205 fix: sync open reference forms after Quality Inspection updates them
update_qc_reference() writes the QI link and bumps the reference
document's modified timestamp via raw db writes, which emit no realtime
event. A reference form (Purchase Receipt, Delivery Note, Stock Entry,
Job Card) still open in the browser keeps the old timestamp and fails
the timestamp conflict check on the next save/submit, forcing a manual
refresh after every QI submit/cancel/delete.

Calling notify_update() on the reference publishes the standard
doc_update event, so an open, unedited form silently reloads and syncs
its timestamp. get_lazy_doc skips child table loading since
notify_update only needs the parent row.

(cherry picked from commit 647452c95b)
2026-08-09 10:39:05 +00:00
Mihir Kandoi
db4f6db753 Merge pull request #57909 from frappe/mergify/bp/version-15-hotfix/pr-57876
fix: allow selecting a warehouse for new items in the update items dialog (backport #57876)
2026-08-09 13:17:57 +05:30
Mihir Kandoi
ee27df7d2b Merge pull request #57912 from frappe/mergify/bp/version-15-hotfix/pr-57911
fix: tolerate floating-point drift in sales team allocated percentage  (backport #57911)
2026-08-09 13:07:26 +05:30
Mihir Kandoi
d4ed2074d5 fix: use stock settings for warehouse defaults 2026-08-09 13:01:01 +05:30
Mihir Kandoi
206d291817 chore: resolve conflict 2026-08-09 12:50:38 +05:30
Mihir Kandoi
c23aa72dff chore: resolve conflict 2026-08-09 12:41:55 +05:30
pandiyan
1a89609044 test: sales team allocation totalling 100 in floating point
covers the case where the percentages are correct but the accumulated
sum is 100.00000000000001. two rows can never drift, since the second
reconstructs exactly as 100 - first, so the case needs three rows.

(cherry picked from commit 4afba94d1c)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
2026-08-09 06:59:23 +00:00
pandiyan
262fbc52d8 fix: tolerate floating-point drift in sales team allocated percentage
the total of allocated_percentage was compared to 100 with exact float
equality, so a correct allocation could be rejected when the sum drifts
in binary floating point (10.0 + 58.02 + 31.98 -> 100.00000000000001).

round the total to the field precision before comparing, in both
SellingController.calculate_contribution and Customer.validate.

(cherry picked from commit f7b2775829)
2026-08-09 06:59:22 +00:00
mergify[bot]
7d9abee6b4 refactor(accounts)!: rework Purchase Invoice hold actions and enforce them on Journal Entry (backport #57825) (#57867)
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2026-08-09 06:50:44 +00:00
Pandiyan P
76f485ba43 fix: allow selecting a warehouse for new items in the update items dialog (#57876)
(cherry picked from commit 55fe269046)

# Conflicts:
#	erpnext/accounts/services/child_item_update.py
#	erpnext/public/js/utils.js
#	erpnext/selling/doctype/sales_order/test_sales_order.py
2026-08-09 06:01:36 +00:00
Mihir Kandoi
8fc5cb2444 Merge pull request #57907 from frappe/mergify/bp/version-15-hotfix/pr-57832
fix: validate webform for project (backport #57832)
2026-08-09 09:59:47 +05:30
nishkagosalia
680ce70c35 fix: validate webform for project
(cherry picked from commit 126966d1db)
2026-08-09 04:12:10 +00:00
mergify[bot]
af7953a933 fix: set restrict_globals=True in frappe.render_template (backport #57899) (#57901)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-08-09 00:04:14 +05:30
Mihir Kandoi
de9d306bfd Merge pull request #57891 from mihir-kandoi/backport-57887-v15
fix: repost read stale sibling SLE rate for moving average returns (backport #57887)
2026-08-08 12:02:32 +05:30
Mihir Kandoi
e63a81b269 Merge pull request #57888 from frappe/mergify/bp/version-15-hotfix/pr-57886
fix: incorrect entry detection in Stock Ledger Invariant Check (backport #57886)
2026-08-08 11:43:21 +05:30
Mihir Kandoi
c45ea3545d fix: get_valuation_method takes no company argument on version-15 2026-08-08 11:24:44 +05:30
Mihir Kandoi
8131af9405 fix: zero-rate repost fallback could still read sibling SLE
When the in-memory running rate is zero, the fallback went through
get_incoming_rate, whose previous-SLE lookup matches the same
posting_datetime and can land on a sibling line of the voucher being
replayed. Replace it with get_previous_sle_of_current_voucher excluding
the current voucher, keeping the get_valuation_rate chain when no
previous entry exists. get_incoming_rate is no longer used in this
module.
2026-08-08 11:12:41 +05:30
Mihir Kandoi
9c8d5ac8a5 test: repost of multi-line moving average return is idempotent
Reposting a return that removes most of the stock across several lines
of the same item must keep every line at the running average and produce
identical results on a second repost. Before the fix the first repost
already drifted, seeding each line from a sibling row of the same
voucher.
2026-08-08 11:12:41 +05:30
Mihir Kandoi
5738cfce79 fix: repost read stale sibling SLE rate for moving average returns
During repost, a return line with recalculate_rate resolved its moving
average rate through get_incoming_rate -> get_previous_sle, which matches
posting_datetime <= and orders by creation desc. For a multi-line return
of the same item, every line shares one posting_datetime, so the query
landed on a sibling line of the same voucher whose stored valuation_rate
was still the previous repost run's output, not the rate before the
voucher.

Each repost run therefore re-seeded the voucher from its own prior
output. The error gain per run is (qty returned at the stale rate) /
(qty remaining after the return), so whenever a return removes most of
the stock the loop diverges instead of converging, alternating sign and
growing until stock_value overflows decimal(21,9) and the repost dies
with 'Out of range value for column stock_value'.

Use the in-memory running valuation rate that update_entries_after
already tracks for the warehouse at this point in the repost. It is the
authoritative pre-entry state, is immune to sibling rows, and makes the
repost idempotent. The database lookup is kept only as a fallback for a
zero in-memory rate, preserving the existing zero-rate fallback chain.
2026-08-08 11:12:41 +05:30
Mihir Kandoi
529ff251fb fix: incorrect entry detection in Stock Ledger Invariant Check (#57886)
(cherry picked from commit b3f97cd389)
2026-08-08 05:31:48 +00:00
Shllokkk
ec7d7cce5c Merge pull request #57881 from frappe/mergify/bp/version-15-hotfix/pr-57880
fix: guard reconciliation table deletes when tables are missing (backport #57880)
2026-08-07 22:00:33 +05:30
Shllokkk
140e06dfa4 fix: guard reconciliation table deletes when tables are missing
(cherry picked from commit 8a2b2a2b68)
2026-08-07 14:34:58 +00:00
Mihir Kandoi
522d7bb1a9 Merge pull request #57869 from frappe/mergify/bp/version-15-hotfix/pr-57866
fix: optimize product bundle item search (backport #57866)
2026-08-07 16:05:07 +05:30
Krishna Shirsath
52a1b124b2 fix: optimize product bundle item search
(cherry picked from commit b3867f1428)
2026-08-07 10:33:15 +00:00
rohitwaghchaure
e2ded11e09 fix: purchase return of batchwise valuation batch valued at original receipt rate instead of batch avg rate (version-15-hotfix) (#57837)
* fix: use current batch avg rate for outward returns of batchwise valuation batches

* fix: honor zero batch average and avoid duplicate batch classification query
2026-08-06 15:20:34 +05:30
pandiyan
ce898a9695 fix: clear deferred revenue/expense fields on uncheck (backport #57140) 2026-08-06 11:25:35 +05:30
Shllokkk
242c950d1b test: assert asset repair downtime recalculates on date change 2026-08-06 00:33:58 +05:30
Shllokkk
0e9c08d494 fix: keep asset repair downtime in sync with entered dates 2026-08-06 00:33:58 +05:30
Mihir Kandoi
1bfe2e25ef Merge pull request #57727 from frappe/mergify/bp/version-15-hotfix/pr-57725
fix(stock): scope over deliver/receive role check to delivery and receipt overflow (backport #57725)
2026-08-05 16:05:25 +05:30
Sudharsanan11
5e7860362e fix(stock): grant account access in blanket order role test 2026-08-05 15:16:27 +05:30
Mihir Kandoi
b25a2f2cdf fix: resolve version-15 backport conflicts
Keep validate_warehouses() and add validate_over_delivery_receipt_allowance();
validate_serial_and_batch_no_settings() does not exist on this branch.

Keep this branch's field labels and add only the non_negative flag the
backported commit introduced.

Drop test_over_order_allowance_against_material_request and
test_blanket_order_over_order_aggregated_across_rows: both are develop-only
context the cherry-pick swallowed into the conflicts, and Buying Settings has
no over_order_allowance field here.

Use frappe.tests.utils.change_settings instead of ERPNextTestSuite, which this
branch does not have.

Revert the valuation_method literal to the three options this branch offers -
Standard Cost rode along from a regenerated develop type block.
2026-08-05 15:16:27 +05:30
Afsal Syed
21c3e07f48 test(stock): prevent settings leakage in purchase order tests
(cherry picked from commit 99630f40eb)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/test_purchase_order.py
2026-08-05 15:16:27 +05:30
Afsal Syed
f5ab55c38d test(stock): add test cases verifying stock over delivery role does not bypass order allowance
(cherry picked from commit 0b271e24b6)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/test_purchase_order.py
#	erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py
2026-08-05 15:16:27 +05:30
Afsal Syed
328c72da18 fix(stock): scope over deliver/receive role check to delivery and receipt overflow
(cherry picked from commit 248873034d)

# Conflicts:
#	erpnext/controllers/status_updater.py
2026-08-05 15:16:27 +05:30
Afsal Syed
7be8a99a23 fix(stock): validate over delivery/receipt allowance in stock settings
(cherry picked from commit 446ec6030a)

# Conflicts:
#	erpnext/stock/doctype/stock_settings/stock_settings.json
#	erpnext/stock/doctype/stock_settings/stock_settings.py
2026-08-05 15:16:27 +05:30
mergify[bot]
ebdc0cdf7f fix(stock): handle multi-item opening balance in Stock Ledger report (backport #57591) (#57795)
* fix(stock): handle multi-item opening balance in Stock Ledger report (#57591)

* fix(stock): handle multi-item opening balance in Stock

* test(stock): add unit test for multi-item Stock Ledger report

---------

Co-authored-by: Afsal Syed <afsalsyed12@gmail.com>
(cherry picked from commit 0dbe410414)

# Conflicts:
#	erpnext/stock/report/stock_ledger/stock_ledger.py
#	erpnext/stock/report/stock_ledger/test_stock_ledger_report.py

* fix(stock): resolve stock ledger backport conflicts

---------

Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com>
Co-authored-by: Sudharsanan11 <sudharsananashok1975@gmail.com>
2026-08-05 13:15:59 +05:30
mergify[bot]
69c00b3362 fix(accounts receivable): made territory field multi select (backport #57322) (#57808)
fix(accounts receivable): made territory field multi select (#57322)

(cherry picked from commit 1029cd988a)

Co-authored-by: Jatin3128 <140256508+Jatin3128@users.noreply.github.com>
2026-08-05 07:35:28 +00:00
Jatin3128
edc8daae21 fix(subscription): don't reactivate a cancelled subscription (backport #57774) (#57780)
* fix(subscription): don't reactivate a cancelled subscription

Backport of #57774 to version-15-hotfix.

set_subscription_status() unconditionally set status to Active once
there was no outstanding invoice, with no check for whether the
subscription had been intentionally cancelled. process()'s
cancel_at_period_end check compared posting_date against
getdate(self.end_date), and getdate(None) returns today, so an empty
end_date was silently treated as "cancel now" on every reprocess.

version-15-hotfix does not yet have the Payment Entry -> invoice ->
refresh_subscription_status() hook chain that #57761 reports (that
was added later), and the scheduler already excludes Cancelled
subscriptions, so the exact automatic repro in the issue does not
apply here. The underlying status logic is defective the same way
though, and reachable directly (e.g. any caller invoking the
whitelisted process()/set_subscription_status() on a cancelled
subscription), so fixing it here too rather than leaving the same
class of bug in place.

Related to #57761

* fix(test): avoid tripping the unrelated period-end cancel clause

The test backdated start_date to 2018-01-01, so by the time process()
ran, current_invoice_end was long past. That made the *other* half of
the cancel_at_period_end OR-condition (period end reached) true on
its own, so process() tried to cancel an already-cancelled
subscription and hit cancel_subscription()'s "already cancelled"
guard - unrelated to the empty end_date bug being tested.

Use nowdate() as start_date so current_invoice_end sits safely in the
future, isolating the assertion to the empty end_date guard. Also
drop the fragile intermediate "Unpaid" status assertion, which
wasn't part of what this test verifies.

* fix(subscription): don't let period rollover defeat cancel_at_period_end

process() can advance current_invoice_end to the next period (via
update_subscription_period(), when generating the current period's
invoice) before the cancel_at_period_end check further down runs. For
a subscription with no end_date, that check now compared posting_date
against the already-rolled-forward current_invoice_end, which is
always in the future, so cancel_at_period_end was silently never
honored.

Snapshot current_invoice_end before any rollover and use that in the
check instead, so it still targets the period that just ended.

Fixes the P1 flagged by Greptile review on this PR.

---------

Co-authored-by: test <test@test.com>
2026-08-05 12:26:01 +05:30
Shllokkk
e3af2f9302 Merge pull request #57800 from Shllokkk/savc-child-account-override-test
test: child warehouse account override in stock vs account value comparison
2026-08-05 01:35:33 +05:30