* feat: sync serial no status from stock ledger in Stock Qty vs Serial No Count report
* fix: pick last bundle move in SQL ordered by posting datetime and SLE creation
* fix: derive synced serial no status from stock ledger helper and validate sync args
* fix: use posting datetime for last bundle move after version-15 field rename
* fix: order last bundle moves by bundle posting datetime
fix(stock): confirm before changing item qty from the batch selector (#58123)
the batch selector silently overwrote the item qty with the bundle total,
so editing a row qty in the dialog changed the delivered qty without any
warning. prompt for confirmation when the rows do not add up to the qty
to fetch, and only proceed if the user agrees.
(cherry picked from commit a2976dd29e)
Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com>
FrappeTestCase on this branch rolls back per class, not per test, so
sibling tests leak state. test_new_warehouse_can_inherit_inventory_account
left an explicit account on the root group, which made later ambiguous
fixtures resolve through the root: the insert validation stopped raising
and the unresolved warehouse stayed in the map.
The fixture helper now clears group warehouse accounts so every call
re-establishes ambiguity. The fallback test also clears the account of
the warehouse it picks, since a leftover explicit account skips the
single-account fallback it asserts.
Move the insert-time check from before_insert to validate. before_insert
runs before set_new_name, so the validation message rendered the
warehouse name as None. validate runs after naming and only applies to
new documents via is_new().
Resolve inheritance through the parent's lft/rgt bounds instead of the
request-cached warehouse account map. The cached map can be stale within
a request (a parent created moments earlier is missing from it), which
made get_warehouse_account trigger a full nested-set rebuild_tree and
could falsely reject a child whose parent carries a valid account.
rebuild_tree enables auto_commit_on_many_writes, which must not run
inside a document insert.
v15 adaptation of the develop fix: the timer flow here runs through
add_time_log via make_time_log, so gate that instead of the
start_timer/complete_job_card methods that only exist on develop, and
hide Start Job while transfer is pending. Corrective job cards and
job cards without items (transfer against Work Order) stay exempt,
matching validate_transfer_qty on submit.
`time_diff_in_hours` returns hours, so `time_in_mins` needs `* 60`, not
`/ 60`. Matches `Job Card.validate_time_log_row`.
No behaviour change: the `doc.save()` on the next line runs Job Card's
`validate`, which recomputes `time_in_mins` correctly before the row is
written. This only stops the expression from reading as a bug.
(cherry picked from commit 422a9161dd)