Commit Graph

59253 Commits

Author SHA1 Message Date
Sudharsanan Ashok
0fbea6021b Merge pull request #59165 from frappe/mergify/bp/version-16-hotfix/pr-59160
fix(stock): forward company to outward batch lookup (backport #59160)
2026-09-18 18:27:09 +05:30
Khushi Rawat
236464e6cc Merge pull request #59184 from frappe/mergify/bp/version-16-hotfix/pr-59181
fix(accounts): clarify revaluation journal filters (backport #59181)
2026-09-18 17:57:53 +05:30
pandiyan
eebd0bc533 fix(accounts): clarify revaluation journal filters
(cherry picked from commit dc4b390a9b)
2026-09-18 12:23:25 +00:00
rohitwaghchaure
c055faabc1 feat(stock): GL-only reposting from Stock and Account Value Comparison report (#59127)
* feat(stock): repost only GL entries from the value comparison report

Adds a "Create GL Reposting Entries" button to the Stock and Account Value
Comparison report, next to the existing "Create Reposting Entries" which is
unchanged. It queues Repost Item Valuation entries with
`repost_only_accounting_ledgers` set, so the General and Payment Ledger are
rebuilt for the selected vouchers while the stock ledgers and valuation rates
are left untouched. This is for the case where stock valuation is already
correct and only the accounting ledger has drifted, which avoids paying for a
full revaluation.

Rows of ledger type "GL Entry" are rejected: they have accounting entries but
no stock ledger entries to rebuild them from, so a GL-only repost would just
wipe their GL. The same restriction is enforced on Repost Item Valuation for
callers outside the report.

Repeated selections are deduplicated, and vouchers that already have a queued
or in-progress GL-only repost are skipped.

* feat(stock): bound GL reposting by a From Date, skip non-stock rows

* fix: batch the pending GL repost lookup and index it on existing sites
2026-09-18 17:02:15 +05:30
Sudharsanan Ashok
62f560a91d Merge pull request #59159 from frappe/mergify/bp/version-16-hotfix/pr-59155
fix(stock): continue putaway allocation after undersized whole-uom rules (backport #59155)
2026-09-18 15:16:23 +05:30
Pandiyan P
5e1cfa4f52 fix(stock): forward company to outward batch lookup (#59160)
(cherry picked from commit 622b7e0caa)
2026-09-18 09:07:13 +00:00
Khushi Rawat
a28767599f Merge pull request #59163 from frappe/mergify/bp/version-16-hotfix/pr-59142
fix: validate shipping rule account company (backport #59142)
2026-09-18 14:33:05 +05:30
pandiyan
f61caa5211 test: cover shipping rule account company validation
(cherry picked from commit 022ee73d78)
2026-09-18 14:18:08 +05:30
pandiyan
dbb8981fa1 fix(stock): continue putaway allocation after undersized whole-uom rules (#59155)
(cherry picked from commit 6cc500e28d)
2026-09-18 14:16:00 +05:30
Khushi Rawat
816880b010 Merge pull request #59157 from frappe/mergify/bp/version-16-hotfix/pr-59081
fix(accounts): validate bank reconciliation date ranges (backport #59081)
2026-09-18 14:13:24 +05:30
pandiyan
590fff6a45 fix: validate shipping rule account company
(cherry picked from commit 340feb94a1)
2026-09-18 08:37:20 +00:00
pandiyan
0634cf31c7 test: cover bank reconciliation date validation
(cherry picked from commit 62d0e2c82e)

# Conflicts:
#	erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py
2026-09-18 13:54:27 +05:30
pandiyan
a878951c17 fix: validate bank reconciliation date ranges
(cherry picked from commit 970f32a342)

# Conflicts:
#	erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py
2026-09-18 13:51:57 +05:30
Sudharsanan Ashok
56db17919b Merge pull request #59126 from frappe/mergify/bp/version-16-hotfix/pr-59116
fix: retain bom components without warehouse stock (backport #59116)
2026-09-18 11:55:49 +05:30
Sudharsanan Ashok
11cbcbe02a Merge pull request #59119 from frappe/mergify/bp/version-16-hotfix/pr-59104
fix(stock): allow zero completed quantity and handle process loss in job cards (backport #59104)
2026-09-18 11:55:10 +05:30
Sudharsanan Ashok
5d4271b1c7 Merge pull request #59145 from frappe/mergify/bp/version-16-hotfix/pr-59143
fix(manufacturing): include the mrp bucket that ends on to_date (backport #59143)
2026-09-18 11:40:01 +05:30
Sudharsanan Ashok
cbd932e20d Merge pull request #59093 from frappe/mergify/bp/version-16-hotfix/pr-59007
fix(manufacturing): apply mrp manufacturing buffer as a duration (backport #59007)
2026-09-18 11:12:56 +05:30
Sudharsanan Ashok
4ad08db1d6 Merge pull request #59090 from frappe/mergify/bp/version-16-hotfix/pr-58923
fix(stock): filter item group defaults by company and non-group records (backport #58923)
2026-09-18 11:12:02 +05:30
Sudharsanan11
131343de28 fix(manufacturing): include the mrp bucket that ends on to_date (#59143)
(cherry picked from commit 5d5eeb5e02)
2026-09-18 11:00:06 +05:30
rohitwaghchaure
16b1821f35 perf: reduce memory consumption during reposting (backport #59117) (#59149)
* perf: reduce memory consumption during reposting

The reposting queue introduced in #52152 keeps the complete future stock
ledger of every transitively dependent item-warehouse in a single deque.
Each `select *` row is ~3.5KB, so a repost spanning a million entries
needs several GB and gets OOM killed on smaller workers.

- Queue only the identity and sort keys of an entry, and fetch the full
  row in batches of 500 just before it is processed
- Move `for update` off the bulk prefetch onto the batch, so millions of
  rows are no longer locked for the whole duration of the repost
- Drop the process local document cache and message log at every
  checkpoint, neither is evicted within a long running job

* fix: keep recent repost messages and log skipped entries

Trimming `frappe.local.message_log` to empty at every checkpoint discarded
warnings that the Repost Item Valuation failure handler reads back when
building the error log. Keep the most recent messages instead, which bounds
the growth just as well.

Also log when a queued entry is no longer active by the time its batch is
loaded, rather than skipping it silently.

* fix: skip reposts already covered by a Manufacture/Repack dependant repost

While reposting a raw material, the finished goods produced from it are
reposted as dependants, from the posting datetime of the manufacture entry
through to the end of their ledger. A repost queued separately for the same
finished good and warehouse at a later datetime therefore has nothing left to
do, but it was still picked up and walked the same entries again.

Track the item-warehouse combinations pulled in as dependants of a Manufacture
or Repack entry, and mark the redundant queued reposts as Skipped once the
dependants have been reposted. This runs per item being reposted, so the
finished good's queued repost is released without waiting for the whole raw
material repost to finish.

Only 'Item and Warehouse' reposts are skipped. A 'Transaction' repost spans
several item-warehouse combinations, so covering one says nothing about the
rest. Reposts starting before the manufacture entry still have work to do and
are left queued.

* fix: don't lock the whole repost queue prefetch

* test: repost covers every entry once across batches
2026-09-18 09:03:48 +05:30
mergify[bot]
d2042bc1bb feat: mark update_serial_batch_entries patch as never skippable (backport #59147) (#59148)
feat: mark update_serial_batch_entries patch as never skippable (#59147)

(cherry picked from commit aebb160e76)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2026-09-17 17:10:48 +00:00
Sudharsanan Ashok
652fc96e85 Merge pull request #59088 from frappe/mergify/bp/version-16-hotfix/pr-58998
fix(stock): use stored posting_datetime when reposting stock ledger entries (backport #58998)
2026-09-17 18:44:36 +05:30
Sudharsanan11
6fab4e0203 fix: resolve conflicts 2026-09-17 18:28:20 +05:30
Sudharsanan Ashok
39d6f2a236 fix(stock): use stored posting_datetime when reposting stock ledger entries (#58998)
* fix(stock): use stored posting_datetime for repost boundary

get_stock_ledger_entries re-derived posting_datetime from posting_date and
posting_time on every call, discarding the stored value its callers pass in.
when a row's stored posting_datetime differs from that pair, the replay window
is built from the wrong instant: the row falls outside the range filter and is
never recomputed, while get_previous_sle still selects it as the opening
balance and reuses its stale qty_after_transaction. every later entry inherits
the error, leaving bin qty adrift from the sum of its ledger.

derive the boundary only when the caller has not supplied one.

* fix(stock): match current voucher sle on stored posting_datetime

get_sle_against_current_voucher selected rows with an equality check against a
posting_datetime re-derived from posting_date and posting_time. a row whose
stored posting_datetime differs from that pair matches nothing, so reposting
the voucher silently processes zero entries and the row can never be corrected
through its own voucher.

read the timestamp from the stored row when the sle is known, and derive it
only as a fallback.

* test(stock): cover repost with diverged posting_datetime

add a repack scenario whose incoming entry stores a posting_datetime one
microsecond before its own posting_time. asserts the voucher lookup still
finds that entry, and that reposting replays it instead of reusing its stale
qty_after_transaction, which otherwise left bin qty at 115 against 615 of
recorded movements.

(cherry picked from commit 6cee9c330c)

# Conflicts:
#	erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
2026-09-17 18:28:20 +05:30
Afsal Syed
4f984aeecf fix(stock): allow zero completed quantity and handle process loss in job cards (#59104)
(cherry picked from commit 1d8ce1ee8c)
2026-09-17 13:47:17 +05:30
pandiyan
18ee3b9cc0 fix: retain bom components without warehouse stock (#59116)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
(cherry picked from commit 60913b722a)
2026-09-17 11:16:48 +05:30
Sudharsanan Ashok
3eca07169e Merge pull request #59098 from frappe/mergify/bp/version-16-hotfix/pr-59097
fix: avoid pricing rule help template errors (backport #59097)
2026-09-17 11:09:26 +05:30
Sudharsanan Ashok
3acf4e7606 Merge pull request #59096 from frappe/mergify/bp/version-16-hotfix/pr-58899
fix: clear stock value for zero-quantity balances (backport #58899)
2026-09-17 11:08:34 +05:30
pandiyan
007a1f5528 fix: clear stock value for zero-quantity balances (#58899)
* fix: clear stock value for zero-quantity balances

* test(stock): cover zero-quantity residual stock values

(cherry picked from commit b439bdda68)
2026-09-17 10:52:57 +05:30
Shllokkk
c42df7ef3e Merge pull request #59108 from frappe/mergify/bp/version-16-hotfix/pr-59078
fix: render letter head jinja in statement of accounts pdf (backport #59078)
2026-09-16 16:44:24 +05:30
Shllokkk
31111a4a30 fix: render letter head jinja in statement of accounts pdf
(cherry picked from commit da377683d6)
2026-09-16 10:10:24 +00:00
mergify[bot]
877747c133 fix: update modified for last purchase rate (backport #59044) (#59106)
fix: update modified for last purchase rate (#59044)

(cherry picked from commit f6b907ef9d)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2026-09-16 15:37:19 +05:30
rohitwaghchaure
86fe0c1f4b perf(stock): chunk the serial and batch entry backfill patch (#59076)
* perf(stock): chunk the serial and batch entry backfill patch

* fix(stock): support postgres in the serial and batch entry backfill patch
2026-09-16 15:23:08 +05:30
rohitwaghchaure
262fdf3e69 fix: negative stock value for moving average item with mixed batchwise valuation (#59099)
* fix: negative stock value for moving average item with mixed batchwise valuation

* chore: remove redundant docstring

* test: restore frappe flags in a finally block
2026-09-16 14:49:01 +05:30
Pandiyan P
e3ef3be490 fix: avoid pricing rule help template errors (#59097)
(cherry picked from commit 2273448f1b)
2026-09-16 07:40:46 +00:00
rohitwaghchaure
f09ce0583f feat: use serial no wise valuation switch on item (#59082)
* perf: speed up legacy serial no valuation lookup

* feat: use serial no wise valuation switch on item

* fix: clear stale valuation method cache on item update

* fix: force moving average only when stock transactions exist

* fix: correct serial no wise valuation field description

* fix: add type hints to whitelisted get_incoming_rate args
2026-09-16 12:24:18 +05:30
pandiyan
fa732ca3f4 fix(manufacturing): apply mrp manufacturing buffer as a duration (#59007)
(cherry picked from commit 2ad4a8c4a4)

Include the material-type helper required by the duration calculation on version 16.
2026-09-16 12:05:39 +05:30
pandiyan
741ae5d33c fix(stock): filter item group defaults by company and non-group records (#58923)
(cherry picked from commit 00ee694444)
2026-09-16 12:05:13 +05:30
Sudharsanan Ashok
378c756d52 Merge pull request #59016 from frappe/mergify/bp/version-16-hotfix/pr-58994
fix(stock): calculate batch bundle valuation per unit (backport #58994)
2026-09-16 11:03:43 +05:30
mergify[bot]
3c9d9d62aa fix(asset): skip missing checkbox columns in asset type patch (backport #58416) (#58417)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2026-09-16 01:39:55 +02:00
Khushi Rawat
78cac8ed09 Merge pull request #59083 from frappe/mergify/bp/version-16-hotfix/pr-58941
fix: asset depreciation table stays empty if you check the box before entering the amount (backport #58941)
2026-09-16 00:03:31 +05:30
Khushi Rawat
9cf6582b4b chore: remove unnecessary comments
(cherry picked from commit 514c3b45d0)
2026-09-15 18:28:32 +00:00
Henil
dfde7d811c fix(assets): discard stale set_finance_book responses
Rapid successive edits to Net Purchase Amount could fire overlapping
set_finance_book calls; if an older request's response arrived after a
newer one, it could overwrite Finance Books with values computed from
a stale amount. Now the callback only applies a response if the fields
it was based on still match the form's current values.

(cherry picked from commit 5a8126412a)
2026-09-15 18:28:32 +00:00
Henil
1652f6ea42 fix(assets): build Finance Books even when Calculate Depreciation is checked before Net Purchase Amount is entered
Previously, checking "Calculate Depreciation" (or picking the Item)
before typing in "Net Purchase Amount" left the Finance Books table
empty, because the depreciation schedule was only built at the moment
those fields already had values. Entering the amount afterward only
updated existing Finance Books rows, so an empty table stayed empty.

Now, entering the amount also builds Finance Books from scratch if it
was left empty, regardless of the order fields were filled in.

(cherry picked from commit 5d1ffa7fca)
2026-09-15 18:28:32 +00:00
Sudharsanan Ashok
105f62fa2c Merge pull request #59013 from frappe/mergify/bp/version-16-hotfix/pr-58997
fix: prevent disabled items from being used in BOM (backport #58997)
2026-09-15 22:07:31 +05:30
Sudharsanan Ashok
05e69f6777 Merge pull request #58943 from frappe/mergify/bp/version-16-hotfix/pr-58925
fix(stock): set item_name to fetch if empty in packing slip item (backport #58925)
2026-09-15 17:59:09 +05:30
MochaMind
6f01469613 chore: update POT file (#59046) 2026-09-15 12:14:29 +02:00
Krishna Pramod Shirsath
05e89fe53f Merge pull request #59005 from frappe/mergify/bp/version-16-hotfix/pr-58037
feat(stock): multi select item and warehouse filters in warehouse wise item balance (backport #58037)
2026-09-15 15:00:21 +05:30
Mihir Kandoi
7db6303ac2 fix(stock): value stock entry rows as of the posting date (backport #59042) (#59048) 2026-09-15 12:14:04 +05:30
MochaMind
442fcd33e9 fix: sync translations from crowdin (version-16-hotfix) (#59052)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-09-14 19:05:44 +02:00