Commit Graph

55630 Commits

Author SHA1 Message Date
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
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
Mohd Haris
d6f797d077 fix: use account currency in Bank Reconciliation Statement print
The custom print template formatted debit/credit amounts with
format_currency() without passing a currency, so it fell back to the
company/system default currency (e.g. INR) instead of the selected bank
account's currency. The on-screen report already formats correctly via
the column's account_currency option.

Pass each row's account_currency to format_currency() so the printed/PDF
output matches the on-screen currency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 12:02:24 +05:30
Mihir Kandoi
75dd6e12a4 Merge pull request #57251 from frappe/mergify/bp/version-15-hotfix/pr-57249
fix: add fetch from in production plan material request child table (backport #57249)
2026-07-18 07:40:37 +05:30
Mihir Kandoi
6ffd759968 fix: add fetch from in production plan material request child table
(cherry picked from commit dfc2a411e1)
2026-07-17 22:25:30 +05:30
Mihir Kandoi
09aaaac388 Merge pull request #57246 from frappe/mergify/bp/version-15-hotfix/pr-57241
fix: validate buying price list on material request and update item rates on change (backport #57241)
2026-07-17 22:04:07 +05:30
Mihir Kandoi
1fabf78dea chore: remove unneccessary flt 2026-07-17 21:43:19 +05:30
Mihir Kandoi
74e9718871 fix: dont overwrite rate with 0 if not found 2026-07-17 21:43:19 +05:30
Mihir Kandoi
302cbbe5d8 fix: pass ctx keys get_price_list_rate_for reads, skip rate update on insert
update_item_rates passed price_not_uom_dependent, a key
get_price_list_rate_for never reads, and omitted conversion_factor, so a
stock-UOM price was never converted to the row UOM. The function's
(historically misnamed) price_list_uom_dependant ctx key carries the
Price List's price_not_uom_dependent value: truthy returns the found
rate as-is, falsy multiplies by conversion_factor.

Also guard on_update with is_new(): has_value_changed returns True when
there is no doc_before_save, so every first save re-wrote item rates.
2026-07-17 21:43:19 +05:30
Mihir Kandoi
96dc408484 fix: validate buying price list on material request and update item rates on change 2026-07-17 21:43:19 +05:30
mergify[bot]
88443e4a97 fix: restrict jinja globals in process statement of accounts templates (backport #56458) (#57231)
Co-authored-by: Shllokkk <shllokosan23@gmail.com>
2026-07-17 08:25:47 +00:00
Diptanil Saha
5e539643ec chore: bump frappe dependency from 15.40.4 to 15.111.0 (#57229) 2026-07-17 13:35:04 +05:30
mergify[bot]
fd01171df5 fix: added missing validations for Dunning Type (backport #57224) (#57226)
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2026-07-17 13:34:30 +05:30
Shllokkk
4148d32ea5 Merge pull request #57218 from frappe/mergify/bp/version-15-hotfix/pr-57198
fix: strip account number when building account name in COA importer (backport #57198)
2026-07-17 11:38:48 +05:30
Mihir Kandoi
74dd90faa6 Merge pull request #57210 from frappe/mergify/bp/version-15-hotfix/pr-57179
feat(stock): automatically link portal users to their associated contact profiles for customers and suppliers (backport #57179)
2026-07-17 07:48:34 +05:30
Afsal Syed
9414230671 chore: fix test case user context 2026-07-17 00:21:48 +05:30
Afsal Syed
1b6ff72f0f test(stock): add portal user contact link verification for customer and supplier
test(stock): add portal user contact link verification for customer and supplier
2026-07-16 23:21:47 +05:30
Shllokkk
314dd16aa3 fix: strip account number when building account name in COA importer
(cherry picked from commit cbe406ee2a)
2026-07-16 15:21:32 +00:00