Commit Graph

60850 Commits

Author SHA1 Message Date
Mihir Kandoi
ce0cdfb492 fix(manufacturing): bound transfer guard by the claim sum
The per-submit allowance guard projected stored effective transferred
qty plus the entry claim, so claim-less coverage (pick list, material
request) and corrective job card transfers wrongly consumed the claim
budget (test_corrective_job_card_transfer_excluded_from_transferred_qty).
Bound the projection by the claim sum, which already excludes corrective
and additional entries.
2026-08-13 12:20:13 +05:30
Mihir Kandoi
99e2538b25 test(manufacturing): cover rounding-loss snapping 2026-08-13 12:05:04 +05:30
Mihir Kandoi
6f301b1545 fix(manufacturing): snap near-full transfer coverage to landmarks
UOM conversion-factor truncation makes fully transferred rows sum
marginally below the requirement, storing values like 172.4789 for a
172.5 work order. Snap coverage fractions within 0.1% of a landmark
(full transfer, transfer allowance) to that landmark.
2026-08-13 12:04:52 +05:30
Mihir Kandoi
e5e2176da8 fix(manufacturing): restore transfer allowance guard per submit
The redesign dropped the claim-sum StockOverProductionError entirely,
letting a single entry claim more than planned qty plus allowance
(test_allow_overproduction). Validate on stock entry submit instead:
already-recorded effective transferred qty plus the submitting entry's
For Quantity must stay within the allowance. Cross-entry claim sums no
longer block the honest remainder after an under-covered entry, because
the recorded base is row-derived.
2026-08-13 12:04:51 +05:30
Mihir Kandoi
4e7d5aaced test(manufacturing): cover alternative-item return coverage 2026-08-13 11:46:25 +05:30
Mihir Kandoi
e4393ff16b fix(manufacturing): keep original_item on work order material returns
Return rows built from transferred materials dropped original_item, so a
returned alternative was keyed under the alternative item code and never
reduced the substituted required item's net coverage in
material_transferred_for_manufacturing.
2026-08-13 11:46:25 +05:30
Mihir Kandoi
9068fe93cf test(manufacturing): cover remainder, mixed-flow, and return coverage 2026-08-13 11:43:51 +05:30
Mihir Kandoi
754462801e fix(manufacturing): derive transferred qty from net item coverage
Follow-up to 329126a8d2; review findings: the claim capped away
legitimate coverage and the claim-sum validation still blocked the
honest remainder.

- material_transferred_for_manufacturing is now owned solely by the
  recomputation: finished-good qty covered by net item transfers
  (non-additional transfers minus returns, alternatives mapped to the
  original required item), capped at planned qty plus the transfer
  allowance instead of a hard 1.0 fraction.
- update_work_order_qty delegates the field to that recomputation and no
  longer validates SUM(fg_completed_qty) for transfers, so the
  advertised remainder submits after an under-covered entry; inflated
  claims cannot reach the stored value anyway.
- Coverage from For Quantity = 0 entries (pick list / material request)
  adds to claimed entries instead of being capped away, and returns
  reduce both the stored value and the In Process predicate.
2026-08-13 11:43:51 +05:30
Mihir Kandoi
4577930312 test(manufacturing): cover transferred qty capping 2026-08-13 11:42:55 +05:30
Mihir Kandoi
f084d72d84 fix(manufacturing): cap transferred qty by actual material coverage
A Material Transfer for Manufacture entry could claim any For Quantity
regardless of what its rows carry; the work order copied that claim into
material_transferred_for_manufacturing on submit. Editing rows down after
generating the entry marked the work order fully transferred, blocking
further transfers and allowing manufacture entries without material.

Cap SUM(fg_completed_qty) by the finished-good qty the transferred item
quantities actually cover (the pick-list min-fraction rule). Status now
treats any raw-material transfer as material movement, not only pick list
or material request sourced entries, so a zero-coverage partial transfer
still moves the work order to In Process.
2026-08-13 11:42:55 +05:30
Khushi Rawat
1fd653b1d3 Merge pull request #57563 from khushi8112/refactor-depreciation-entry
refactor: split make_depreciation_entry into public and internal helpers
2026-08-13 11:38:53 +05:30
Mohsin Akhtar
e72aabcdb8 Fix/item description in the item price list (#58084) 2026-08-13 09:41:30 +05:30
rohitwaghchaure
c6d08979d3 feat: capacity aware scheduling for production plan (#58094)
* feat: capacity aware scheduling for production plan

* fix: do not apply incomplete schedule proposals

* fix: lock plan re-scheduling once work orders exist

* test: concurrent jobs across multiple machines with job capacity

* chore: fix linter and semgrep issues

* fix: readable subject for production plan schedule entries

* fix: persist computed start for item rows without explicit dates

* fix: block manual creation of production plan schedule entries

* chore: replace em-dashes with hyphens in design doc

* fix: cleared item-wise dates no longer constrain the schedule

* chore: format test file
2026-08-12 12:40:03 +00:00
Mihir Kandoi
43de54b907 fix(work order): exclude corrective transfers from item-level transferred qty (#58091) 2026-08-12 11:11:12 +00:00
Mihir Kandoi
e5a0b5f61e fix(manufacturing): refine corrective job cards (#58079) 2026-08-12 10:13:29 +00:00
Mihir Kandoi
68a30f1568 fix(work order): don't count corrective job card transfers as transferred qty (#58080) 2026-08-12 15:35:55 +05:30
Mihir Kandoi
994703c2f3 Merge pull request #58073 from mihir-kandoi/codex/mrp-detailed-chart-timescale
fix(manufacturing): show full date range in MRP chart
2026-08-12 14:54:15 +05:30
Khushi Rawat
ca1b03cd46 Merge pull request #57820 from aerele/fix-asset-capitalization-grouped-row-valuation
fix(assets): split fifo/lifo rate across grouped stock item rows
2026-08-12 14:34:12 +05:30
Krishna Pramod Shirsath
18dff27f65 Merge pull request #57995 from krishna-254/fix/available-batch-report-company-filter
fix: filter available batch report by company
2026-08-12 13:19:16 +05:30
Mihir Kandoi
5ad085887d fix(manufacturing): keep MRP chart dates distinct 2026-08-12 12:28:13 +05:30
Krishna Pramod Shirsath
c34e6fba32 Merge branch 'develop' into fix/available-batch-report-company-filter 2026-08-12 12:23:04 +05:30
Krishna Shirsath
484beb9fba fix: filter available batch report by company 2026-08-12 12:18:25 +05:30
Mihir Kandoi
592924cc0d test(manufacturing): cover MRP chart date range 2026-08-12 11:39:53 +05:30
MochaMind
83e33b343c fix: sync translations from crowdin (#58070) 2026-08-11 23:28:18 +00:00
Diptanil Saha
c52552ecfa fix(coa_importer): added server-side validations for importing chart of accounts (#58065) 2026-08-12 03:32:19 +05:30
Vishnu Priya Baskaran
89e2c3c3e5 fix: allow non-admin roles to import chart of accounts (#57454) 2026-08-11 23:26:58 +05:30
Vishnu Priya Baskaran
39403a5ef3 refactor:fix item property updates in POS and transactions, and add styling (#57189)
Co-authored-by: Afsal Syed <afsalsyed12@gmail.com>
2026-08-11 22:50:28 +05:30
soulxone
3c17a604be fix(Material Requirements Planning Report): detailed-view chart timescale
The detailed-view chart collapsed every row into a single "today" column
and was additionally capped at 10 points, so the chart never matched the
report's date filters or the table data.

Two causes in get_detailed_view_chart_data:

1. `row.deliver_date` was a typo for `row.delivery_date` (the name used
   everywhere else in this report). On a frappe._dict the missing
   attribute resolves to None, so `getdate(None)` returned today and the
   past-date filter silently compared every row against today instead of
   its own delivery date.

2. A hard `if i == 10: break` truncated the chart to 10 date buckets.

Use the correct field name and drop the cap. The null check now runs
before the date comparison, since `getdate(None)` returning today meant
the original ordering could never filter a null delivery_date out.

Fixes #52632
2026-08-11 11:55:49 -05:00
Vishnu Priya Baskaran
8802000ba2 fix(consolidated cash flow): correct totals and labels in section foo… (#57336) 2026-08-11 21:58:53 +05:30
Raffael Meyer
e591c7e8b6 fix: mirror rounding adjustment on distributed_discount_amount (#58047) 2026-08-11 18:26:26 +02:00
Mihir Kandoi
a7e5e1209b Merge pull request #58051 from mihir-kandoi/codex/fix-sales-order-item-reset
fix(selling): reset stale item details on item change
2026-08-11 21:05:04 +05:30
Mihir Kandoi
e8c890a844 fix(selling): preserve explicit UOM during item selection 2026-08-11 20:54:04 +05:30
Mihir Kandoi
e6966627b8 Merge pull request #58050 from mihir-kandoi/codex/fix-bom-creator-item-selection
fix(manufacturing): preserve BOM Creator item details
2026-08-11 20:53:31 +05:30
Mihir Kandoi
009961edc7 fix(selling): reset stale item details on item change 2026-08-11 20:41:47 +05:30
Mihir Kandoi
439eb250f5 fix(manufacturing): preserve BOM Creator item details 2026-08-11 20:40:30 +05:30
Mihir Kandoi
7e4e9860ef Merge pull request #58045 from mihir-kandoi/codex/repair-underbilled-pr-status
fix(stock): repair existing underbilled purchase receipts
2026-08-11 19:52:08 +05:30
Mihir Kandoi
620465220b test: cover repair of underbilled receipts from mixed billing 2026-08-11 19:21:38 +05:30
Mihir Kandoi
e99ae3796c fix(stock): repair existing underbilled purchase receipts
The qty-sync fix corrects allocation going forward, but receipts billed
before it can keep understated billed_amt, per_billed, and status. The
earlier repair patch only selects over-billed PO items, so it never picks
these up.

Recompute every candidate PO item (multiple submitted receipts, PO-level
invoicing, no invoice-created receipts). update_billed_amount_based_on_po
only writes rows whose recomputed value differs, so already-correct items
are untouched and the patch stays idempotent. This also converges receipts
left with direct-only billed_amt by last-event-wins overwrites.
2026-08-11 19:21:38 +05:30
Mihir Kandoi
4108be4637 Merge pull request #58036 from mihir-kandoi/codex/fix-disabled-warehouse-account-resolution
fix(stock): validate warehouse accounts when used
2026-08-11 18:54:39 +05:30
Mihir Kandoi
ce847b6c29 Merge pull request #58044 from mihir-kandoi/fix-po-billing-qty-sync-develop
fix: keep PO billed qty in sync when allocating amount to receipts
2026-08-11 18:53:46 +05:30
Mihir Kandoi
031e7c0eb7 test: cover mixed direct and PO-invoice billing across receipts 2026-08-11 18:40:35 +05:30
Mihir Kandoi
7803998fce fix: keep PO billed qty in sync when allocating amount to receipts
The amount-capped allocation branch reduced the remaining PO-invoiced
amount but left the invoiced qty untouched. A later receipt entering the
qty-proportional branch then divided by the stale qty and was under-billed:
PO 10 x 500, PO-level PI for 5 (2500), PR1 qty 3 with 500 billed directly
consumes 1000 (pool 2500 -> 1500, qty stuck at 5), PR2 qty 3 got
1500 * 3/5 = 900 instead of its full 1500. Scale the remaining qty by the
consumed fraction so both stay proportional.

Follow-up to #58021.
2026-08-11 18:39:52 +05:30
Mihir Kandoi
abb23fffdc Merge pull request #58021 from harisansari008/fix-po-invoice-billing-distribution-develop
fix: distribute PO-invoice billed amount across receipts without duplication
2026-08-11 18:36:09 +05:30
Mihir Kandoi
b54a4f6285 test(stock): cover named validation error and same-transaction parent inheritance 2026-08-11 18:26:10 +05:30
Mihir Kandoi
624e97f6c1 chore(stock): drop redundant supplier warehouse comment 2026-08-11 18:26:09 +05:30
Mihir Kandoi
d2b5c6ad40 fix(stock): validate new warehouse inventory account after naming
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.
2026-08-11 18:26:08 +05:30
Mihir Kandoi
0171b07023 Merge pull request #58032 from aerele/perf/batch-bin-lookups
perf: batch per-row bin lookups in sales invoice and delivery note
2026-08-11 18:20:50 +05:30
Mihir Kandoi
13883a00b0 fix(stock): validate warehouse accounts when used 2026-08-11 18:16:47 +05:30
Mihir Kandoi
d34519f536 test: cover repair patch exclusion for invoice-created receipts 2026-08-11 18:16:38 +05:30
Mihir Kandoi
ace4230f97 fix: skip PO items with invoice-created receipts in billing repair patch
A Purchase Receipt row created from a Purchase Invoice carries both
purchase_order_item and purchase_invoice_item, and its billed_amt is pinned
to the row amount by update_billing_status. Redistributing the PO-invoiced
pool over such rows zeroes the invoice-created receipt and flips it from
Completed to To Bill, so the repair leaves those PO Items untouched.
2026-08-11 18:16:38 +05:30