Commit Graph

60509 Commits

Author SHA1 Message Date
Mihir Kandoi
a8f189696e feat(job_card): carry the stock uom on the job card
Every quantity the job card reports belongs to the item it produces, but the
document had no unit of its own, so messages could only print bare numbers.

Add the Stock UOM field, set from the finished good or the final product, and
backfill the job cards that already exist.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
02c066a634 refactor(job_card): make the completion dialog say what it asks for
The dialog qty shares the Qty to Manufacture label with the field on the form
while it means the current cycle only, its title fell back to the generic Enter
Value because frappe.prompt takes four arguments and it was passed five, and
nothing on it stated that the three quantities have to add up.

Name the cycle in the label, title the dialog after the button that opens it,
and describe the split on the fields. Same wording in the shop floor dialog.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
f48538aeae refactor(job_card): drop the unused make_finished_good handler
Nothing triggered it and Job Card has no make_finished_good method to call.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
2c131d5819 test(job_card): cover the completion qty split guard 2026-08-01 15:09:51 +05:30
Mihir Kandoi
e042d09975 fix(job_card): reject a completion split that cannot add up
The completion dialogs silently dropped a recalculation whose result went
negative, so entering a pending qty larger than what is left of the qty to
manufacture kept the contradiction (3 to manufacture, 3 completed, 2 pending)
and the job card only failed much later, on submission.

Keep the split consistent while it is entered: reset the pending qty when the
qty to manufacture changes, and refuse a completed, pending or process loss qty
that leaves the others negative. complete_job_card validates the same rule, so
the shop floor and the API cannot store a split that will never submit.

Also name the three parts in the submission error instead of calling their sum
the Total Completed Qty, which read as a contradiction of the field itself.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
2565a56ade test(job_card): cover a job card completed with a pending qty 2026-08-01 15:09:51 +05:30
Mihir Kandoi
3fab303e51 fix(job_card): leave the pending qty out of the job card's own output
Pending qty is the part of a job card handed over to another job card, but the
status and the manufacturing entry still measured the card against its full
for_quantity. A card submitted with 3 completed and 2 pending was stuck at Work
In Progress with no way to change it, and its manufacturing entry was built for
the full 5.

Measure both against for_quantity minus pending qty, so the card reaches To
Manufacture on submission, its manufacturing entry covers the completed qty, and
it is Completed once that qty is manufactured.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
6ef498e352 test(job_card): cover qty to manufacture from the completion dialog
Reducing the dialog qty resizes the job card without inventing process loss, and
a pending qty split across two cycles leaves for_quantity untouched.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
9815d90b0f fix(job_card): apply the completion dialog's qty to manufacture
Both the desk dialog and the shop floor session dialog send for_quantity when
completing a job card, but complete_job_card dropped it. Reducing Qty to
Manufacture to 3 on a job card of 5 left for_quantity at 5, so set_process_loss
turned the untouched 2 into process loss on the next save.

The dialog qty covers the current cycle, so add it to the qty already completed
by the earlier cycles of the job card instead of overwriting for_quantity, and
validate the pending qty against the result.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
fb763848da test(job_card): cover manufactured qty check across previous operations
Work order with operations A and B at sequence 1 and C at sequence 2, tracking
semi finished goods. C stays blocked while A's job card is submitted but its
Manufacture entry is missing, and once A is manufactured for 3, C can only be
completed for 3.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
c2654c1380 fix(job_card): block next operation until previous operation is manufactured
With track semi finished goods, Work Order Operation completed_qty is set from
the submitted job cards' total completed qty, so a job card of the next
operation could be started and completed even when no Manufacture entry existed
for the previous operation. The semi-finished goods it consumes were never
produced.

Validate the sequence against the qty actually manufactured against the previous
operations' job cards (Manufacture entries / Subcontracting Receipts) when the
work order tracks semi finished goods.
2026-08-01 15:09:51 +05:30
Mihir Kandoi
6be6bf2929 ci: fall back to develop when frappe has no matching branch (#57693)
* ci: fall back to develop when frappe has no matching branch

The frappe branch to install is taken from the pull request's base branch. A
stacked pull request targets another erpnext branch, so the clone fails with
"couldn't find remote ref", no bench is installed, and every job that needs one
fails with it.

Fall back to develop when the base branch does not exist in frappe. An explicit
FRAPPE_BRANCH is left alone, since it can be a commit sha rather than a branch.

* ci: only fall back when frappe is known to lack the branch

git ls-remote --exit-code reports 2 for a branch that is not there and 128 for a
remote it could not reach. Treating both as absence let a transient network or
DNS failure install develop over the branch the pull request was built against.

Fall back on 2 alone and log anything else, so a flaky probe leaves the branch
as it was.
2026-08-01 09:38:14 +00:00
Diptanil Saha
ceefd4add7 Merge pull request #57201 from diptanilsaha/fix/perms_whitelisted_methods
fix: permission checks on various whitelisted methods
2026-08-01 14:46:34 +05:30
Mihir Kandoi
e694d45ed4 Merge pull request #57679 from Shllokkk/reserved-stock-dashboard-net-transferred
fix: exclude transferred and consumed qty from dashboard reserved stock
2026-08-01 14:33:32 +05:30
diptanilsaha
0659bd7049 fix(payment_request): added permission checks on resend_payment_email 2026-08-01 14:28:29 +05:30
diptanilsaha
3b0cbc972e fix(item_variant): added permission checks on enqueue_multiple_variant_creation 2026-08-01 14:28:29 +05:30
diptanilsaha
09d721d1be fix(assets): add permission checks on whitelisted methods on asset_capitalization 2026-08-01 14:28:24 +05:30
Shllokkk
6c36624d91 fix: exclude transferred and consumed qty from dashboard reserved stock 2026-08-01 13:24:46 +05:30
Shllokkk
ebb5d933ea Merge pull request #57668 from Shllokkk/reserve-stock-accept-dict-doc
fix: allow reserving stock from work order dialog
2026-07-31 21:15:49 +05:30
Diptanil Saha
0a047b410a fix(plant_floor): add missing perm check on get_stock_summary (#57667) 2026-07-31 14:52:17 +00:00
Shllokkk
517053bc25 fix: drop row prefix in reserve stock message when row is unknown 2026-07-31 20:12:15 +05:30
Shllokkk
f29c7de0ef fix: accept dict doc when reserving stock for work order 2026-07-31 20:12:15 +05:30
Diptanil Saha
0fdca37506 fix: use payment entry posting date for received amount exchange rate (#57660) 2026-07-31 17:47:43 +05:30
Sudharsanan Ashok
9a4594ac06 fix: resolve default expense account fallback in gl composer (#57433)
fix: update stock variance account logic which defaults to default expense account set in company

Co-authored-by: Afsal Syed <afsalsyed12@gmail.com>
2026-07-31 14:02:09 +05:30
Mihir Kandoi
a6bdf7905e Merge pull request #57650 from aerele/fix/material-transfer-qty-precision
fix: respect quantity precision in material transfer validation
2026-07-31 12:40:15 +05:30
Sudharsanan11
cf72e03f39 test: cover material transfer quantity precision 2026-07-31 12:09:43 +05:30
Sudharsanan11
1ff8bf7971 fix: respect quantity precision in material transfer validation 2026-07-31 12:09:36 +05:30
Jatin3128
fd7765ac02 fix: filter Accounts Receivable by invoice sales partner (#57628)
Filter Accounts Receivable and AR Summary on the Sales Invoice's own
sales_partner instead of the customer's default_sales_partner, and read
the Sales Partner column from the invoice. Returns are attributed to the
invoice they settle, matching how the Sales Person filter works.
2026-07-31 11:42:17 +05:30
Diptanil Saha
9e659938d7 fix(quotation): carry forward communications from opportunity at after_insert (#57639) 2026-07-31 05:05:26 +00:00
ruthra kumar
caac1468b7 Merge pull request #57434 from aerele/pcv-status-update
fix: update doc status in period closing voucher
2026-07-31 10:34:36 +05:30
Mihir Kandoi
41cc4ffeb6 Merge pull request #57606 from aerele/fix/stock-entry-items-add-scio-guard
fix: guard scio row lookup in stock entry items_add
2026-07-31 08:56:06 +05:30
pandiyan
6e444a1832 fix: guard scio row lookup in stock entry items_add
check the result of find() before reading t_warehouse off it. on a
'receive from customer' entry with no row carrying scio_detail, find()
returns undefined and items_add throws a typeerror.

the throw rejects the serially-run handler chain, so the stock entry
controller's own items_add never runs and the new row silently loses
its target warehouse, expense account, cost center and serial/batch
field defaults.

leave t_warehouse unset when no reference row exists, so the rest of
the chain still runs.
2026-07-31 08:54:33 +05:30
rohitwaghchaure
d59c5e36bc feat: status based bar colors in Work Order gantt view (#57634) 2026-07-30 23:24:59 +05:30
rohitwaghchaure
386a4ac1f0 fix: do not fetch a random inventory account when multiple inventory accounts exist (#57626) 2026-07-30 14:13:45 +00:00
nareshkannasln
b3c2ba5381 fix: validate account frozen date 2026-07-30 17:14:44 +05:30
Jatin3128
7febc28ed6 feat: auto-fill subscription accounting dimensions from plan with item fallback (#57615)
When a plan is selected in the Subscription's Plans table, the Subscription's
accounting dimensions (cost center and any custom dimensions) auto-fill from the
plan, falling back to the plan item's company default (selling cost center for a
Customer, buying for a Supplier). Only empty fields are filled. Stale async
responses are ignored so a quick re-pick of the plan can't be overwritten.
2026-07-30 15:07:15 +05:30
Shllokkk
956105579d Merge pull request #57618 from Shllokkk/asset-manual-create-valuation-rate
fix: source manually created asset value from valuation rate
2026-07-30 14:52:50 +05:30
Shllokkk
46e01c2d92 fix: source manually created asset value from valuation rate 2026-07-30 14:25:41 +05:30
Mihir Kandoi
e65e1d3c96 Merge pull request #57616 from mihir-kandoi/fix/item-group-root-seeding
fix: seed standard Item Groups under the existing tree root
2026-07-30 13:24:52 +05:30
Mihir Kandoi
e7088d8981 fix: seed standard Item Groups under the existing tree root
install_fixtures always inserted "All Item Groups" as a parentless group.
On a site where another app had already created the root, ItemGroup.validate
re-parented it, leaving a second group-root that held the standard groups
while the real root held everything else.

This is reproducible with the healthcare app on a non-English site: its
after_install seeds the root as _("All Item Groups"), so a pt-BR site gets
"Todos os Grupos de Itens" as the root before the setup wizard runs. The
split predates #57390 -- the old translated-name lookup resolved to the same
root and produced an identical tree.

Resolve the root once with get_root_of (falling back to the canonical English
name on fresh installs) and use it for the root record's exists-guard and the
standard groups' parent, matching Company.create_default_departments.

Patch merges an already-seeded "All Item Groups" into the root it sits under,
lifting its children and repointing every link.

Closes #57581
2026-07-30 13:08:28 +05:30
Soham Kulkarni
ec02b5fa64 Merge pull request #57614 from sokumon/item-default
fix: unchecking default workspace
2026-07-30 12:39:16 +05:30
sokumon
85fa6596b8 fix: unchecking default workspace 2026-07-30 12:23:00 +05:30
Mihir Kandoi
0a7c8504e6 Merge pull request #57609 from mihir-kandoi/fix/title-field-parity
fix(projects): read the Timesheet label from the employee field
2026-07-30 08:36:31 +05:30
Mihir Kandoi
38e5674ea4 chore(stock): drop the dead title template on Material Request
`set_title()` runs in validate and always fills `title` first, so
`set_title_field()` never renders `{material_request_type}`, and
create_new.js skips defaults for the field `title_field` names. Titles
stay "<type> Request for <items>".
2026-07-30 08:22:01 +05:30
Mihir Kandoi
03d84430b6 fix(projects): read the Timesheet label from the employee field
Timesheet was the only doctype where the {...} template on `title`
actually rendered: `title_field` was `title`, so `set_title_field()`
seeded it from `{employee_name}` on insert. A `default` renders once, so
reassigning a draft left the stored title — and every label derived from
it — on the previous employee, with no way to correct it from the form
because the field is hidden.

Point `title_field` at `employee_name` so the label reads the live field
instead of a copy that drifts. Existing rows need no backfill.
2026-07-30 08:22:00 +05:30
Mihir Kandoi
f71946def7 Merge pull request #57419 from kaulith/fix/update-items-row-removal-permission
fix: don't require cancel and delete perms to remove items via Update Items
2026-07-29 16:42:26 +05:30
Khushi Rawat
4f1adb8a94 Merge pull request #57520 from khushi8112/feature/default-modern-print-formats
feat: default new sites to the Modern with Images print formats
2026-07-29 15:47:08 +05:30
Jatin3128
cfe18e8427 fix: let Purchase Receipt cancel defer to Frappe's linked-document check (#57592)
on_cancel pre-blocked cancellation with its own "Purchase Invoice is
already submitted" guard, duplicating the check Frappe already runs for any
submitted linked document. Drop the guard and the unused check_next_docstatus()
method it mirrored so the receipt defers to the framework: the Cancel All
Documents flow cancels the invoice first and then the receipt, and a direct
cancel is still rejected by Frappe's linked-document check.

Add a regression test that a direct cancel of a receipt with a submitted
invoice is rejected and rolls back, leaving no stray stock or GL entries.
2026-07-29 14:44:32 +05:30
Jatin3128
6b8b9d3644 test: isolate accounts settings mutation in overdue threshold test (#57441)
* test: isolate accounts settings mutation in overdue threshold test

test_overdue_billing_threshold_on_submit mutated the Accounts Settings singleton
without restoring it, so a failed assertion mid-test leaked
enable_overdue_billing_threshold and the bypass role into later tests that submit
sales invoices. Wrap the mutations in try/finally and restore the originals. Also
assert that a 0 overdue limit on the customer inherits the customer group's limit.

* test: restore credit limits in overdue threshold fallback test
2026-07-29 12:38:33 +05:30
Nabin Hait
b86ad21444 Merge pull request #57314 from krishna-254/fix/skip-italy-einvoice-opening-invoices
fix(italy): skip e-invoicing for opening invoices
2026-07-29 11:08:59 +05:30