Commit Graph

55646 Commits

Author SHA1 Message Date
Mihir Kandoi
168ec661e4 test: assert batch pooling preserves the group total on a repeating rate
(cherry picked from commit 545262c5d4)

# Conflicts:
#	erpnext/stock/report/stock_ageing/test_stock_ageing.py
2026-07-27 08:23:54 +00:00
Mihir Kandoi
f38b3b422d fix: pool batch slot values on every run, not only when negative
A batch is one valuation pool, so any per-slot value difference within a
batch is stale detail from the report's own age slots, not real valuation.
The rebalance only ran when consumption had already driven a slot negative,
so a batch whose receipts landed at different rates kept a skewed split
across age buckets (one bucket free, another double-priced) while the total
stayed correct.

Drop the negative-slot precondition and always spread a batch's pooled value
over its slots in proportion to qty. Redistribution preserves group totals,
so buckets still sum to Stock Balance; only the split across ages changes.

(cherry picked from commit cedaaa3a00)
2026-07-27 08:23:53 +00:00
ruthra kumar
08f92ed3f8 Merge pull request #57477 from frappe/mergify/bp/version-15-hotfix/pr-57476
refactor: configurable date in reverse ERR journals (backport #57476)
2026-07-27 13:08:22 +05:30
ruthra kumar
435fe19398 refactor(test): manually submit reverse err journal
(cherry picked from commit 1a558ce641)
2026-07-27 12:50:50 +05:30
ruthra kumar
97fa5435bb refactor: configurable date in reverse ERR journals
(cherry picked from commit 0be33e4132)
2026-07-27 12:18:55 +05:30
Shllokkk
1721c408eb Merge pull request #57467 from frappe/mergify/bp/version-15-hotfix/pr-57466
fix: recalculate operating cost on hour rate change in routing (backport #57466)
2026-07-26 16:27:06 +05:30
Shllokkk
4fe91bd8b8 fix: recalculate operating cost on hour rate change in routing
(cherry picked from commit 598f6f0f4e)
2026-07-26 08:36:46 +00:00
rohitwaghchaure
4e8f5de5cb fix: enable the 'Include Zero Stock Items' filter by default to show zero-stock items in the Stock Balance report (#57458) 2026-07-25 00:21:06 +05:30
Mihir Kandoi
b5d8c7515f Merge pull request #57439 from frappe/mergify/bp/version-15-hotfix/pr-57435
fix(accounts): respect user permissions in party dashboard company list (backport #57435)
2026-07-24 15:21:33 +05:30
pandiyan
348555b127 fix: respect user permissions in party dashboard company list
use frappe.get_list instead of frappe.get_all in get_dashboard_info so
the company list honors user permissions. previously, a party with
invoices across multiple companies would raise "User don't have
permissions to select/read this account" for users restricted to a
subset of companies, since get_party_account was called for companies
the user could not access.

fixes frappe/erpnext#57428

(cherry picked from commit 903c87bcaa)
2026-07-24 09:30:23 +00:00
Mihir Kandoi
04a281e299 Merge pull request #57422 from aerele/backport-57412-customer-pick-list-v15
fix: map pick list customer to delivery note when no sales order
2026-07-24 14:58:14 +05:30
pandiyan
0dc5894499 fix: map pick list customer to delivery note when no sales order
backport of #57412
2026-07-23 21:29:36 +05:30
Mihir Kandoi
0752fcfe69 Merge pull request #57414 from frappe/mergify/bp/version-15-hotfix/pr-57413
fix: typeerror in get_batches_by_oldest for mixed batch expiry (backport #57413)
2026-07-23 18:46:43 +05:30
pandiyan
56bd024f39 fix: typeerror in get_batches_by_oldest for mixed batch expiry
sort on (expiry is none, expiry) so a null expiry_date is never
order-compared against a datetime.date, which raised typeerror in
python 3 when a warehouse held both dated and never-expiring batches.

(cherry picked from commit 62c9f8ee3e)
2026-07-23 12:53:35 +00:00
Mihir Kandoi
df936009e5 Merge pull request #57407 from frappe/mergify/bp/version-15-hotfix/pr-57400
fix: guard against missing is_your_company_address custom field on ad… (backport #57400)
2026-07-23 16:31:17 +05:30
Mihir Kandoi
ce3bd02f82 Merge pull request #57405 from mihir-kandoi/fix-stock-ageing-batch-pool-rebalance-v15
fix: rebalance batch slot values at the pooled rate when driven negative (backport #57403)
2026-07-23 16:13:44 +05:30
pandiyan
6fa522d031 fix: guard against missing is_your_company_address custom field on address
(cherry picked from commit ea3ed8b836)
2026-07-23 10:40:56 +00:00
Mihir Kandoi
3ad971d3f6 Merge pull request #57401 from mihir-kandoi/backport-51019-v15
fix: check if item is variant when creating WO from MR (backport #51019)
2026-07-23 15:58:33 +05:30
Mihir Kandoi
48082020e8 fix: rebalance batch slot values at the pooled rate when driven negative
A batch is one valuation pool, so consumption is valued at the pooled
rate while slots may carry stale intra-batch detail (e.g. units
reconciled at zero and later merged). Consuming such a slot leaves a
negative value on positive qty. Spread the pool value across the
batch's slots when that happens; non-batchwise slots pool per
warehouse.
2026-07-23 15:57:17 +05:30
Mihir Kandoi
bb1320f8df fix: add is_active filter 2026-07-23 15:39:44 +05:30
Mihir Kandoi
745513d0c2 fix: check if item is variant when creating WO from MR 2026-07-23 15:39:43 +05:30
Shllokkk
c740d7db13 Merge pull request #57394 from frappe/mergify/bp/version-15-hotfix/pr-57359
fix: respect selected BOM when creating work order for variant item (backport #57359)
2026-07-23 14:21:35 +05:30
Shllokkk
c5235af6bf fix: respect selected BOM when creating work order for variant item (#57359)
* fix: respect selected BOM when creating work order for variant item

* fix: add type hints to make_work_order

(cherry picked from commit 1132eb1a0f)
2026-07-23 08:19:36 +00:00
Krishna Pramod Shirsath
c1afc55abd Merge pull request #57379 from krishna-254/fix/reverse-journal-entry-save-button
fix: restore Save button on reverse journal entry
2026-07-23 10:17:27 +05:30
Krishna Shirsath
d9373850ad fix: restore Save button on reverse journal entry 2026-07-23 09:54:23 +05:30
Mihir Kandoi
27a48a7ab8 Merge pull request #57347 from mihir-kandoi/fix-neg-stock-cancel-replay-v15
fix: seed cancelled voucher replay from before its posting datetime (v15)
2026-07-22 13:09:42 +05:30
Mihir Kandoi
1ff297e9da fix: seed cancelled voucher replay from before its posting datetime
On cancel, update_entries_after replays every live SLE at the voucher's
posting datetime, but get_previous_sle_of_current_voucher seeded the
replay with the reversal SLE's creation, which resolves to the bucket's
own closing row. The bucket's net qty got double-counted into every
same-datetime row, so later submissions passed negative stock validation
against inflated balances, and the queued repost then rewrote correct
values with allow_negative_stock forced on, silently creating negative
stock. Backports the missing guard from eca71dce54.
2026-07-22 12:51:39 +05:30
mergify[bot]
3efddfd270 fix(payments): ensure payments app installed on the site in payment_app_import_guard (backport #57342) (#57343)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-07-21 21:40:17 +00:00
mergify[bot]
0249e0dfbe chore: remove apiclient (backport #57339) (#57340)
* chore: remove `apiclient` (#57339)

(cherry picked from commit 6d31af3a52)

# Conflicts:
#	pyproject.toml

* chore: resolve conflict

* chore: bump python-youtube to 0.9.9

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-07-21 20:41:06 +00:00
Shllokkk
588b7c8f03 Merge pull request #57325 from frappe/mergify/bp/version-15-hotfix/pr-57321
fix: sync process loss percentage when fg qty changes (backport #57321)
2026-07-21 17:37:16 +05:30
Mihir Kandoi
a77919eeb2 Merge pull request #57326 from mihir-kandoi/fix-stock-balance-ageing-batch-flag-v15
fix: read serial and batch flags from Item in Stock Balance's SLE query
2026-07-21 17:18:38 +05:30
Shllokkk
81e865f6c7 fix: resolve merge conflicts 2026-07-21 17:03:41 +05:30
Mihir Kandoi
e7f0461b57 fix: read serial and batch flags from Item in Stock Balance's SLE query
Stock Balance builds stock ageing by passing its own SLE rows into
FIFOSlots, whose gates read row.has_batch_no and row.has_serial_no.
The query never selected has_batch_no at all, and read has_serial_no
from the SLE column, which is unset on rows predating v15's bundle
migration (no backfill patch exists). With the flags falsy, incoming
batch/serial stock was queued as plain qty slots while outgoing was
consumed batch/serial-wise, so the shapes never consume each other,
and bundle-based rows resolved no batch details, letting the plain
consume path overwrite batch slots in place (flt(batch_no) reads as
qty 0). Besides wrong ageing figures, sorting the resulting queue
crashed with TypeError: '<' not supported between 'int' and
'datetime.date'.

Select both flags from Item, matching Stock Ageing's own query. Only
this report is affected; develop dropped the sle_entries pass-in in
#44489.
2026-07-21 17:02:29 +05:30
Shllokkk
f0e24e2f53 fix: sync process loss percentage when fg qty changes
(cherry picked from commit beeffee8f9)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2026-07-21 10:55:17 +00:00
Mihir Kandoi
1b992b85bb Merge pull request #57318 from mihir-kandoi/fix-stock-ageing-reco-revaluation-v15
fix: rescale stock ageing FIFO slot values on stock reconciliation (backport #57316)
2026-07-21 15:46:07 +05:30
Mihir Kandoi
b9ff5be43e fix: resolve float precision before streaming stock ledger entries
get_single_value inside _revalue_reconciled_batch_slots runs while
rows stream through the unbuffered cursor on MariaDB, killing the
active iterator. Resolve it once in generate() with the other
prefetches.
2026-07-21 14:34:15 +05:30
Mihir Kandoi
1679bdecdc fix: use system float precision for batch qty comparison 2026-07-21 14:18:28 +05:30
Mihir Kandoi
2673029bd4 fix: revalue batch reco slots only when the entry covers the full batch
stock_value_difference / qty equals the new batch rate only when the
reco entry carries the entire batch, as the split out/in reco SLEs and
batches reconciled from zero do. Partial direct-batch_no entries mix a
qty delta with existing stock, so their slots keep prior values.

Plain items need no such guard: the valuation engine collapses the
FIFO stack to qty_after * valuation_rate on every reconciliation, so
rescaling remaining slots at the reco rate matches the ledger. Lock
that with a test.
2026-07-21 14:09:36 +05:30
Mihir Kandoi
72b3210cbb fix: rescale batch FIFO slot values on stock reconciliation
Batch items take the batch-slot path, which mirrors the same value
arithmetic: the reco's incoming entry dumps the revaluation remainder
on one slot. Rescale each reconciled batch's slots at its post-reco
rate (stock_value_difference / qty of the incoming bundle entry).
2026-07-21 13:49:45 +05:30
Mihir Kandoi
d51f9076b5 fix: rescale stock ageing FIFO slot values on stock reconciliation
A reconciliation's stock_value_difference includes the revaluation of
stock already in the FIFO queue, but the whole amount was attached to
the qty-delta slot while older slots kept pre-revaluation values. A
downward revaluation therefore produced negative bucket values in the
Stock Ageing report, and repeated recos let the queue total drift away
from Stock Balance.

Re-derive every slot value as qty * valuation_rate after processing a
reco SLE, since a reconciliation values the entire balance at its rate.
Covers both single-SLE recos and the zero-out/re-add pair that flows
through the transfer bucket.
2026-07-21 13:45:03 +05:30
Khushi Rawat
fbde3212e2 Merge pull request #57309 from khushi8112/fix/default-accounting-dimension-new-documents
fix: apply default accounting dimensions reliably on new documents
2026-07-21 12:34:51 +05:30
khushi8112
88abe119c3 fix: apply default accounting dimensions reliably on new documents
Default accounting dimensions were applied from the `company` client
trigger, which reads dimension data fetched asynchronously in
`setup_dimension_filters`. When the trigger fired before that fetch
returned, new documents were left without their default dimensions, and
Sales Order never called `update_dimension` at all.

- Apply defaults from the fetch callback in dimension_tree_filter.js so
  they no longer depend on `company`-trigger timing. This fixes the race
  for Sales Invoice, Purchase Invoice and Payment Entry, and populates
  defaults on new Sales Orders.
- Add a `company()` override on SalesOrderController so the default is
  re-applied when the company changes, matching the sibling doctypes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 11:39:05 +05:30
mergify[bot]
319841d59c refactor: rework appointment booking lifecycle and portal verification (backport #57270) (#57294)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-07-21 03:23:32 +05:30
mergify[bot]
2cd531d099 fix: block changing Stock account type when stock ledger entries exist (backport #57283) (#57284)
fix: block changing Stock account type when stock ledger entries exist (#57283)

(cherry picked from commit 4cdaa8dba6)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2026-07-20 22:58:36 +05:30
Mihir Kandoi
91f085c8e3 Merge pull request #57303 from frappe/mergify/bp/version-15-hotfix/pr-57301
feat(stock): expose all Bin qty fields in Stock Summary and Stock Projected Qty (backport #57301)
2026-07-20 20:39:33 +05:30
Mihir Kandoi
90009a4687 feat(stock): expose all Bin qty fields in Stock Summary and Stock Projected Qty
Stock Summary's sort selector only offered 5 of Bin's 10 qty fields; add
the rest (ordered, requested, planned, reserved for production plan,
reserved stock) and extend get_data's or_filters so bins whose only
nonzero qty is one of the new fields show up when sorted by it. Sort
labels now mirror Bin field labels.

Stock Projected Qty report had a column for every Bin qty field except
reserved_stock; add it.

(cherry picked from commit 59c0c15c2e)
2026-07-20 14:48:04 +00:00
Mihir Kandoi
fd1fcd8e58 Merge pull request #57281 from frappe/mergify/bp/version-15-hotfix/pr-57273
fix: correct typo in allow_negative_stock parameter (backport #57273)
2026-07-20 17:52:16 +05:30
ruthra kumar
b521cb9b40 Merge pull request #57278 from harisansari008/fix/bank-reco-print-currency-hotfix
fix: use account currency in Bank Reconciliation Statement print/PDF
2026-07-20 13:14:40 +05:30
Afsal Syed
f24e09cc97 fix: correct typo in allow_negative_stock parameter 2026-07-20 13:08:37 +05:30
mergify[bot]
21e5620e92 fix: project % complete field allowing modification when manual method (backport #57274) (#57275)
Co-authored-by: nishkagosalia <nishka.gosalia@gmail.com>
2026-07-20 12:29:21 +05:30