Commit Graph

60483 Commits

Author SHA1 Message Date
Mihir Kandoi
b37152752f fix(manufacturing): scope BOM Creator tree children to the parent row
The BOM Creator tree identified a node by the parent's item code
(fg_item) instead of the specific BOM Creator Item row, so every
occurrence of a repeated sub-assembly shared one child set: expanding
any one of them listed the raw materials of all of them, and deleting
one wiped the raw materials of its siblings.

Key the tree on fg_reference_id and make the node value the row name,
matching the framework convention that a tree node's value is its
docname. Item code now travels as its own field for the label and for
the fg_item argument sent back on add/convert.

Fixes #57311
2026-07-28 11:25:29 +05:30
Mihir Kandoi
bde118e7cf fix(manufacturing): exclude corrective job cards from semi-FG aggregate 2026-07-28 11:09:36 +05:30
Khushi Rawat
56a9ca334b Merge pull request #57451 from khushi8112/feature/request-for-quotation-print-formats
feat: add four Request for Quotation print formats built with the print format builder
2026-07-28 11:06:33 +05:30
Khushi Rawat
aacccfb958 Merge pull request #57450 from khushi8112/feature/quotation-print-formats
feat: add four Quotation print formats built with the print format builder
2026-07-28 11:06:20 +05:30
Khushi Rawat
bd5d6fb9d8 Merge pull request #57449 from khushi8112/feature/pos-invoice-print-formats
feat: add four POS Invoice print formats built with the print format builder
2026-07-28 11:06:06 +05:30
Khushi Rawat
22334def56 Merge pull request #57447 from khushi8112/feature/purchase-invoice-print-formats
feat: add four Purchase Invoice print formats built with the print format builder
2026-07-28 11:05:51 +05:30
Khushi Rawat
5631acc39b Merge pull request #57446 from khushi8112/feature/purchase-order-print-formats
feat: add four Purchase Order print formats built with the print format builder
2026-07-28 11:05:38 +05:30
Khushi Rawat
dd0f763613 Merge pull request #57445 from khushi8112/feature/delivery-note-print-formats
feat: add four Delivery Note print formats built with the print format builder
2026-07-28 11:05:25 +05:30
Khushi Rawat
b71a9b8273 Merge pull request #57437 from khushi8112/feature/sales-order-print-formats
feat: add four Sales Order print formats built with the print format builder
2026-07-28 11:05:12 +05:30
Khushi Rawat
7a76c5f268 Merge pull request #57430 from khushi8112/feature/sales-invoice-print-formats
feat: add four Sales Invoice print formats
2026-07-28 11:04:59 +05:30
Mihir Kandoi
5548f0726a fix(manufacturing): sum semi-FG qty across split job cards
update_semi_finished_good_details assigned the current job card's
manufactured_qty to Work Order.produced_qty instead of accumulating it,
so a second job card on the same operation overwrote the first. Nothing
corrected it afterwards because StatusService.update_work_order_qty
returns early for track_semi_finished_goods work orders, leaving the
work order stuck below its planned qty with no way to progress.

Aggregate manufactured_qty and completed_qty over the operation's
submitted job cards instead.
2026-07-28 11:04:17 +05:30
Mihir Kandoi
543301701e fix(subcontracting): stop storing "{supplier_name}" as the Subcontracting Receipt title
Subcontracting Receipt was left out of #57493. Its title_field is "title",
so the template does get rendered on insert, but never again — the title
goes stale as soon as the supplier changes.

Point title_field at supplier_name like Purchase Receipt, and give the
title field the same shape as its subcontracting siblings. Existing rows
already hold a rendered name, so no data patch is needed.

Also guard the whole class of bug: a "{...}" default on a title field is
only ever rendered when title_field is "title".
2026-07-28 11:00:57 +05:30
khushi8112
3eb924d052 feat: default new sites to the Modern with Images print formats
Point set_default_print_formats() at the new builder-made
"<Doctype> Modern with Images" formats, falling back to the existing
"with Item Image" formats when the new ones aren't present. Only fresh
sites are affected (the existing default-print-format guard is kept).
2026-07-28 11:00:31 +05:30
Shllokkk
14fd045555 Merge pull request #57471 from Shllokkk/routing-hour-rate-operating-cost
fix: update operating cost when propagating workstation hour rate to routing
2026-07-28 10:50:06 +05:30
Mihir Kandoi
43acbae5a1 Merge pull request #57493 from aerele/fix-subcontracting-title-template
fix: stop storing raw title template on subcontracting orders
2026-07-28 10:41:59 +05:30
Shllokkk
a5250d8e80 Merge branch 'develop' into routing-hour-rate-operating-cost 2026-07-28 01:33:50 +05:30
Sudharsanan Ashok
73224d3650 fix(stock): keep manufactured item rate at zero when inputs are free (#57334)
* fix(stock): keep manufactured item rate at zero when inputs are free

when a finished item is produced from raw materials consumed at zero
valuation, the incoming rate fell back to the item's own valuation
rate (or BOM cost), valuing free inputs as output and inflating the fg
value on every production run.

add has_consumption_basis() to detect when the consumed cost is known
even if it is zero (consumed rows present, or a consumption entry
exists for the work order). when it is, skip the get_valuation_rate and
BOM-cost fallbacks so a real cost of zero is preserved.

* test(stock): cover manufacture rate for zero-valued raw materials

- manufacture from a free input keeps fg basic_rate and sle
  incoming_rate/stock_value_difference at zero even when the fg already
  carries a valuation in the target warehouse
- material consumption on with no consumption entry does not fall back
  to bom/price-list rate for free inputs
- zero-valued consumption entry keeps the manufacture entry's fg rate
  at zero
2026-07-27 23:35:00 +05:30
Sudharsanan Ashok
d37e905322 fix(stock): value batched packed-item returns from the original bundle (#57327)
* fix(stock): value batched packed-item returns from the original bundle

when a return delivery note or sales invoice bundle is built via the
use_serial_batch_fields / sle-driven path, its voucher_detail_no keeps the
packed item instead of being remapped to the parent dn/si item. the return
valuation lookup then misses and the bundle values at zero, so the sle
stock_value_difference stays wrong even after a repost.

resolve the original dn/si item via the packed item's parent_detail_docname
when the direct lookup fails, so the return values from the original outward
bundle on both submit and repost.

* test(stock): cover batched packed-item return valuation on repost
2026-07-27 23:33:41 +05:30
Diptanil Saha
28c96999e2 fix(quotation): carry forward communications from opportunity (#57507) 2026-07-27 23:29:57 +05:30
Sudharsanan Ashok
425191e57e fix(stock): narrow legacy serial ledger lookup by item (#57499)
Filter legacy Stock Ledger Entry lookups by item code so the existing
item and warehouse index can reduce rows scanned during serial valuation.
2026-07-27 21:40:44 +05:30
ruthra kumar
05a15dff71 Merge pull request #57500 from frappe/mergify/bp/develop/pr-57484
fix(test): flaky test in exchange rate revaluation (backport #57484)
2026-07-27 17:21:41 +05:30
ruthra kumar
4e77c9d6e6 fix(test): flaky test in exchange rate revaluation
- remove redundant setup on system settings

(cherry picked from commit 484ff8e349)
2026-07-27 11:40:37 +00:00
Raffael Meyer
bdf586c670 fix: error message wording (#57495) 2026-07-27 11:15:18 +00:00
Mihir Kandoi
3f93887ec8 Merge pull request #57492 from frappe/production-plan-recalculate-bin
fix: recalculate whole bin in Production Plan reservation patch
2026-07-27 16:01:04 +05:30
Mihir Kandoi
88b02130e7 fix: recalculate whole bin for Production Plan raw material items
projected_qty is derived from every bin quantity, so refreshing only
reserved_qty_for_production_plan leaves it stale wherever another field
had drifted. Call Bin.recalculate_values() instead.

Renamed so the patch re-runs on sites that already applied
recompute_production_plan_reserved_qty.
2026-07-27 15:26:25 +05:30
Raffael Meyer
8b37c52187 fix(crm): align Opportunity status checks with Quotation statuses (#57489) 2026-07-27 09:20:22 +00:00
Mihir Kandoi
70fa8c0c2a Merge pull request #57485 from frappe/stock-ageing-batch-slot-pooling
fix: pool batch slot values on every run, not only when negative
2026-07-27 13:53:23 +05:30
Mihir Kandoi
545262c5d4 test: assert batch pooling preserves the group total on a repeating rate 2026-07-27 13:42:25 +05:30
Mihir Kandoi
cedaaa3a00 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.
2026-07-27 13:37:08 +05:30
pandiyan
5008e6126f fix: stop storing raw title template on subcontracting orders
subcontracting order and subcontracting inward order carry a hidden
title field defaulting to "{supplier_name}" / "{customer_name}", while
their title_field points at supplier_name / customer_name. document.
set_title_field() substitutes the template only when title_field is
"title", so every record stores the placeholder verbatim.

drop the dead default and hidden flags, move title into the other info
tab to match purchase order, and add a patch to repair existing rows.
2026-07-27 13:18:31 +05:30
Mihir Kandoi
273e9f2431 Merge pull request #57463 from aerele/fix/sco-closed-reserved-qty
fix(subcontracting): release raw-material reservation when closing a subcontracting order
2026-07-27 12:08:37 +05:30
ruthra kumar
d3448ef9a2 Merge pull request #57476 from ruthra-kumar/date_configurable_err_reversal
refactor: configurable date in reverse ERR journals
2026-07-27 11:40:32 +05:30
ruthra kumar
1a558ce641 refactor(test): manually submit reverse err journal 2026-07-27 11:18:41 +05:30
Sudharsanan11
e4b8065a69 test(subcontracting): cover reservation release on closing a subcontracting order
close a partially-received sco with a reserve warehouse and assert the
raw-material reservation is released and projected qty recovers.
2026-07-27 11:13:17 +05:30
Sudharsanan11
db91a79d31 fix(subcontracting): release raw-material reservation when closing a subcontracting order
the bin reserved-qty recalc filtered out closed purchase orders but not
closed subcontracting orders, so closing a partially-received sco kept the
reservation for the unreceived qty and left projected qty understated.
apply the same closed-status filter to the subcontracting order path.
2026-07-27 11:13:17 +05:30
ruthra kumar
0be33e4132 refactor: configurable date in reverse ERR journals 2026-07-27 11:11:38 +05:30
rohitwaghchaure
f077d2edc0 fix: GL entries for purchase expense with LCV (#57475) 2026-07-26 23:08:35 +05:30
MochaMind
fd37bc3ff8 chore: update POT file (#57469) 2026-07-26 16:10:52 +02:00
Shllokkk
371ab1db61 Merge pull request #57443 from Shllokkk/rename-ar-ap-report-filters
fix: rename misleading filter labels in AR/AP reports
2026-07-26 17:16:42 +05:30
Shllokkk
be27a918e6 Merge pull request #57320 from Shllokkk/create-payment-entries-from-payable-report
fix: show create payment entries as an inner button on row selection
2026-07-26 17:14:35 +05:30
Shllokkk
e08e119739 test: assert operating cost is propagated to routing operations 2026-07-26 16:15:53 +05:30
Shllokkk
eb9afa40ea fix: update operating cost when propagating workstation hour rate to routing 2026-07-26 16:03:09 +05:30
Shllokkk
c6a16495c0 Merge pull request #57466 from Shllokkk/routing-hour-rate-operating-cost
fix: recalculate operating cost on hour rate change in routing
2026-07-26 14:06:28 +05:30
Shllokkk
598f6f0f4e fix: recalculate operating cost on hour rate change in routing 2026-07-26 13:11:11 +05:30
mergify[bot]
8c24c5bd68 fix: enable the 'Include Zero Stock Items' filter by default to show zero-stock items in the Stock Balance report (backport #57458) (#57459)
fix: enable the 'Include Zero Stock Items' filter by default to show zero-stock items in the Stock Balance report (#57458)

(cherry picked from commit 4e8f5de5cb)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2026-07-25 08:27:19 +05:30
Nabin Hait
208a07e19e Merge pull request #57452 from nabinhait/fix-child-qty-rate-type-hint
fix: accept list payload for trans_items in update_child_qty_rate
2026-07-24 21:54:18 +05:30
Shllokkk
f13cd00494 fix: migrate stored AR/AP ageing filter to renamed field 2026-07-24 18:45:07 +05:30
Nabin Hait
d73ff0a2bf fix: accept list payload for trans_items in update_child_qty_rate
The whitelisted endpoint declared trans_items as str, so Frappe's typing
validation raised FrappeTypeError when the client sent the items as a
JSON list. ChildItemUpdater.update already handles both via
frappe.parse_json, so widen the wrapper's hint to str | list.
2026-07-24 17:33:58 +05:30
khushi8112
2d731b3232 fix: remove duplicate supplier name in Bordered format
The right-column Custom HTML block re-displayed the vendor name a
second time. In the source Purchase Order design that block was part
of an address card (name + mailing address together); Request for
Quotation has no per-supplier address field, so after dropping the
address the block became a bare, purposeless repeat of the name
already shown at the top of the left column. Classic, Modern, and
Modern with Images each show it once - Bordered now matches.

Addresses the Greptile review comment on this PR.
2026-07-24 17:26:39 +05:30
khushi8112
fe11252a4d feat: add four Request for Quotation print formats built with the print format builder
Request for Quotation has no pricing fields at all (no rate, amount,
grand_total, in_words), so this is a structurally simplified version
of the Bordered/Classic/Modern/Modern with Images designs rather than
a straight field-swap: Sub Total/Discount/Tax/Grand Total/In Words
sections dropped entirely, item table shows Item/Code/Quantity only.
Supplier fields point at the doctype's own `vendor` field (matching
the existing request_for_quotation_with_item_image standard format's
convention), items table bound to Request for Quotation Item, status
field carries the real RFQ status list, no letter head embedded.
2026-07-24 17:20:28 +05:30