Commit Graph

60488 Commits

Author SHA1 Message Date
Diptanil Saha
0a047b410a fix(plant_floor): add missing perm check on get_stock_summary (#57667) 2026-07-31 14:52:17 +00:00
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
Diptanil Saha
372dff2ffa refactor(accounts): repost accounting ledger (#56442)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 22:51:06 +00:00
Vishnu Priya Baskaran
5125d64b7f fix: clear deferred revenue/expense fields on uncheck (#57140) 2026-07-29 04:18:45 +05:30
Krishna Pramod Shirsath
e0c31f1745 fix: recover failed POS closings (#57203)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2026-07-28 22:29:47 +05:30
Mihir Kandoi
6d748c5523 Merge pull request #57571 from mihir-kandoi/move-warehouse-defaults-to-company
refactor: move warehouse defaults from Stock Settings to Company
2026-07-28 20:28:55 +05:30
Mihir Kandoi
2095073688 fix: check company permission before reading sample retention stock
validate_sample_quantity and move_sample_to_retention_warehouse are
whitelisted and take company from the caller, which selects whose retention
warehouse gets read. The retained batch qty then reaches the return value and
the max-retained warning, so an authenticated user could probe another
company's stock with a known item and batch.

Gate the shared company -> warehouse resolution on read permission for the
Company, which respects User Permissions. validate_sample_quantity only grew
a company argument in this branch; move_sample_to_retention_warehouse already
took one, so this closes that path too.
2026-07-28 20:15:19 +05:30
Mihir Kandoi
ac477bb33c test: stop relying on companies having no default warehouse
Companies now get their Stores warehouse as Default Warehouse, so item
warehouse resolution succeeds where it previously came back empty.

test_internal_pr_reference cleared inter_company_reference and asserted a
ValidationError, but no validation covers that field - the mapper already
sets it. It was incidentally catching 'Row #1: Warehouse is mandatory for
stock Item' from the blank target warehouse, so the assertion never tested
what it claimed. Dropped it; the delivery_note_item assertion below still
covers the reference linkage.

test_inter_company_transaction_without_default_warehouse now establishes its
own premise by clearing the company's default warehouse instead of relying
on it being unset. Its failure previously skipped the teardown that restores
frappe.local.enable_perpetual_inventory, which db rollback cannot undo, which
in turn broke two later inter-company tests.
2026-07-28 20:06:47 +05:30
Mihir Kandoi
455251abe1 fix: throw when the transaction company has no sample retention warehouse
Item.retain_sample is validated against any company having one configured,
since Item is not company-scoped. The transaction company may still not be,
in which case get_batch_qty received warehouse=None and returned its batch
list, which was then compared numerically -> TypeError.

Resolve company -> retention warehouse through one helper that throws a
clear message instead, covering both the sample stock entry and the
whitelisted quantity validation.
2026-07-28 19:41:29 +05:30
Mihir Kandoi
26613d258e refactor: move warehouse defaults from Stock Settings to Company
Default Warehouse and Sample Retention Warehouse were global singles, so every
consumer had to re-check that the warehouse belonged to the transaction's
company before using it. Both now live on Company, under a new Warehouse
Defaults section that also collects the warehouse fields Company already had.

The company check moves to Company.validate_warehouses, which also rejects
group warehouses for all seven fields — a group or cross-company value there
already failed at SLE time, this just surfaces it at the source.

New companies get their Stores warehouse as Default Warehouse via
create_default_warehouses, replacing the setup-wizard and test-fixture code
that seeded the global.
2026-07-28 19:29:18 +05:30
Mihir Kandoi
c80a848216 Merge pull request #57567 from aerele/fix/stock-balance-for-none-row
fix: guard against None row in get_stock_balance_for
2026-07-28 19:26:26 +05:30
Shllokkk
3f0b894cdf Merge pull request #57566 from Shllokkk/item-def-accounting-desc
fix(item): correct description on deferred revenue/expense
2026-07-28 19:22:27 +05:30
Shllokkk
fa75aa08ab fix(item): correct description on deferred revenue/expense 2026-07-28 19:00:24 +05:30
R-Jayaraman
f9d25bc3d3 fix: guard against None row in get_stock_balance_for
row defaults to None but was dereferenced unconditionally when computing
the incoming rate for batch-tracked items, causing an AttributeError for
any caller (e.g. direct API calls) that omits row while still passing
batch_no. The other two row accesses in this function already guard
against None; this brings the incoming-rate check in line with them.
2026-07-28 18:57:06 +05:30
Smit Vora
986cea2331 feat: taxable-base resolver hook for custom charge types (#56175) 2026-07-28 17:21:55 +05:30
Mihir Kandoi
0cd95e1995 fix(manufacturing): fall back to UOM Conversion Factor in Production Plan (#57553)
Production Plan read the conversion factor straight off the item's own
UOM child table, so an item with a purchase UOM but no matching row threw
"UOM Conversion factor not found" while Stock Entry silently resolved it
from the item's variant template or the UOM Conversion Factor doctype.
Resolve it the same way, and keep returning None when nothing is
configured anywhere so the missing-setup error still fires.
2026-07-28 11:41:51 +00:00
Shllokkk
5fc20d6b8e fix: respect child warehouse account override in Stock and Account Value Comparison (#57552)
fix: respect child warehouse account override in stock vs account value comparison
2026-07-28 16:51:53 +05:30
Diptanil Saha
5835709402 fix: add permission check for get_item_details (#57515) 2026-07-28 10:38:40 +00:00
Mihir Kandoi
a051a12d9b Merge pull request #57540 from mihir-kandoi/fix-company-mfg-warehouse-filters
fix(setup): scope manufacturing warehouse filters to company
2026-07-28 14:16:44 +05:30
Mihir Kandoi
632113c309 fix(setup): scope manufacturing warehouse filters to company
Default WIP, Finished Goods and Scrap Warehouse fields on Company listed
warehouses of every company. Filter them by the current company and
exclude group warehouses, matching the other warehouse fields.
2026-07-28 14:10:50 +05:30
Mihir Kandoi
91e4a753b3 Merge pull request #57535 from frappe/fix/silently-swallowed-exceptions
fix: stop swallowing exceptions silently in six places
2026-07-28 13:06:46 +05:30
rohitwaghchaure
4a0a1db17e fix: skip stock expense GL entries for non-stock items (#57519)
* fix: skip stock expense gl entries for non stock items

* test: use a leaf expense account for the service item invoice
2026-07-28 13:00:32 +05:30
Mihir Kandoi
85a04772f6 fix: stop swallowing exceptions silently in six places
- Pricing Rule: log a broken condition instead of dropping the rule
- Payment Request: log gateway validation failures
- Supplier Quotation from RFQ portal: let errors surface instead of
  returning None to a dead submit button
- Bank Transaction Rule: drop the pointless try/except around the
  on_trash unlink; a failed write already aborts the delete
- Statement of Accounts: the CC handler was unreachable
  (frappe.get_value returns None, it does not raise); drop it and
  filter out users without an email
- Bank Statement Import: 'Bank Account' at column 0 is falsy, so the
  column was appended instead of filled
2026-07-28 12:49:08 +05:30