Commit Graph

60248 Commits

Author SHA1 Message Date
Mihir Kandoi
f19216979b Merge pull request #57280 from aerele/timesheet_group_by
fix(report): handle nonetype error in timesheet billing summary group…
2026-07-20 17:43:31 +05:30
Diptanil Saha
73004c6e4b refactor: rework appointment booking lifecycle and portal verification (#57270)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 16:35:58 +05:30
Soham Kulkarni
e728c24b80 Merge pull request #57292 from sokumon/customer
fix: mark selling as default workspace for customer
2026-07-20 16:06:09 +05:30
sokumon
873bce3c46 fix: mark selling as default workspace for customer 2026-07-20 15:53:41 +05:30
Poovetha
9a7209e668 fix(report): handle nonetype error in timesheet billing summary grouping logic 2026-07-20 13:39:07 +05:30
rohitwaghchaure
4cdaa8dba6 fix: block changing Stock account type when stock ledger entries exist (#57283) 2026-07-20 13:20:10 +05:30
Mihir Kandoi
276e688949 Merge pull request #57273 from aerele/typo-fix-allow-negative-stock
fix: correct typo in allow_negative_stock parameter
2026-07-20 12:31:13 +05:30
Nishka Gosalia
ccb9b16378 Merge pull request #57274 from nishkagosalia/gh-57206
fix: project % complete field allowing modification when manual method
2026-07-20 11:46:20 +05:30
nishkagosalia
21009c18c0 fix: project % complete field allowing modification when manual method 2026-07-20 11:34:09 +05:30
Afsal Syed
b3a616c328 fix: correct typo in allow_negative_stock parameter 2026-07-20 10:52:00 +05:30
rohitwaghchaure
2eecdc48bf feat: inline serial and batch entries editor (#57216)
* feat: inline serial and batch entries editor in Purchase Receipt

* feat: grid-style UX, deferred saves, scan and range options for inline serial batch editor

* feat: extend inline serial batch editor to all bundle doctypes with auto fetch

* fix: address review comments on inline serial batch editor

* fix: escape untrusted values in inline editor alerts

* fix: clear child bundle reference only when the row owns the bundle

* fix: keep inline serial batch editor disabled on existing sites via patch
2026-07-19 19:21:09 +05:30
MochaMind
ddb094084e chore: update POT file (#57269) 2026-07-19 14:50:34 +02:00
Mihir Kandoi
1cd32b9c73 Merge pull request #57258 from mihir-kandoi/per-master-company-restriction 2026-07-18 20:39:13 +05:30
Mihir Kandoi
ea5c648ab0 refactor: gate company restrictions per master via Restrict to Companies checkbox
Replaces the Global Defaults toggle. Each Item/Customer/Supplier now
carries a Restrict to Companies checkbox: the Allowed Companies table
only shows (and is mandatory) when checked, is cleared on uncheck, and
permission filtering, read denial and write validation apply only to
masters that have the checkbox set.
2026-07-18 19:03:31 +05:30
Mihir Kandoi
4d49cfa1de Merge pull request #57256 from mihir-kandoi/fix-multi-batch-serial-stock-reco
fix: scope current serial nos to the selected batch in stock reconciliation
2026-07-18 18:56:15 +05:30
Mihir Kandoi
f43f8f75d0 fix: scope current serial nos to the selected batch in stock reconciliation
get_stock_balance_for fetched serial nos across every batch in the
warehouse, so reconciling one batch of a serial+batch item compared the
selected serials against the pool of all batches and failed whenever
multiple batches existed.
2026-07-18 16:51:46 +05:30
Mihir Kandoi
71ccc8885e Merge pull request #57253 from aerele/fix-pick-list-work-order-transferred-qty-leak
fix: exclude transferred_qty from work order item to pick list item m…
2026-07-18 14:05:55 +05:30
pandiyan
5b36f12596 fix: exclude transferred_qty from work order item to pick list item mapping
get_mapped_doc copies same-named fields by default. work order item's
transferred_qty (cumulative across the whole work order) was leaking into
the new pick list item's transferred_qty (meant to track how much of
that pick list row has been converted into a stock entry, starting at 0).

the leaked value then got subtracted again in
get_pending_transfer_stock_qty(), so every pick list after the first
under-transferred raw materials by whatever was already recorded on the
work order, driving material_transferred_for_manufacturing towards zero
across repeated partial pick-list/finish cycles.

fixes #57236, related to #56596
2026-07-18 13:36:48 +05:30
Mihir Kandoi
ca5bec2b77 Merge pull request #57249 from mihir-kandoi/ppmr
fix: add fetch from in production plan material request child table
2026-07-17 22:19:58 +05:30
Mihir Kandoi
dfc2a411e1 fix: add fetch from in production plan material request child table 2026-07-17 22:08:15 +05:30
kaulith
1aee0df79a fix: force-delete repost data file during cleanup (#57245)
* fix(stock): force-delete repost data file during cleanup

* test(stock): cover repost data file cleanup with attach guard
2026-07-17 22:07:20 +05:30
Mihir Kandoi
e0896c656c Merge pull request #57244 from mihir-kandoi/fix-clear-old-logs-orphan-references
fix: clear linked comments, versions and attachments with old logs
2026-07-17 22:06:23 +05:30
Mihir Kandoi
6a69237130 Update erpnext/utilities/__init__.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-07-17 21:53:16 +05:30
Mihir Kandoi
334346e0f8 Merge pull request #57241 from mihir-kandoi/fix-material-request-buying-price-list
fix: validate buying price list on material request and update item rates on change
2026-07-17 21:38:10 +05:30
Mihir Kandoi
3a63f61832 chore: remove unneccessary flt 2026-07-17 21:24:40 +05:30
Mihir Kandoi
1887825ce5 fix: clear linked comments, versions and attachments with old logs
Repost Item Valuation and BOM Update Log cleared old logs with a raw
delete on the parent table, orphaning timeline comments, versions,
attachments and other reference records.

Fixes #57237
2026-07-17 21:24:08 +05:30
Mihir Kandoi
1ef3cd1d3f fix: dont overwrite rate with 0 if not found 2026-07-17 21:23:49 +05:30
Mihir Kandoi
a31119353c Merge pull request #57223 from aerele/project_validation
fix(projects): include on hold status in project filters and reports
2026-07-17 20:46:11 +05:30
Mihir Kandoi
6dcc0cab3a fix: pass ctx keys get_price_list_rate_for reads, skip rate update on insert
update_item_rates passed price_not_uom_dependent, a key
get_price_list_rate_for never reads, and omitted conversion_factor, so a
stock-UOM price was never converted to the row UOM. The function's
(historically misnamed) price_list_uom_dependant ctx key carries the
Price List's price_not_uom_dependent value: truthy returns the found
rate as-is, falsy multiplies by conversion_factor.

Also guard on_update with is_new(): has_value_changed returns True when
there is no doc_before_save, so every first save re-wrote item rates.
2026-07-17 20:44:07 +05:30
Mihir Kandoi
18b15f2ca9 fix: validate buying price list on material request and update item rates on change 2026-07-17 20:44:07 +05:30
Jatin3128
a33da337ec feat: block sales invoice submit when customer overdue exceeds threshold (#57230)
* feat: block sales invoice submit when customer overdue exceeds threshold

Adds an opt-in, per-customer Overdue Billing Threshold. When enabled in
Accounts Settings, submitting a Sales Invoice is blocked if the customer's
overdue amount exceeds their threshold, unless the current user holds a
configured bypass role. Modeled on the existing credit limit feature.

- Accounts Settings (Credit Limits tab): enable toggle + bypass role.
- Per-customer threshold on the Customer Credit Limit table, shown only
  when the feature is enabled via a property setter (same mechanism as
  subscription / accounting dimension sections). Table relabeled to
  "Credit & Overdue Limits".
- Overdue is read live from the ledger via get_outstanding_invoices
  (payments already netted), summing Sales Invoices past their due date.
- Enforced in Sales Invoice on_submit, after the credit-limit check;
  returns are exempt.
- validate_credit_limit_on_change no longer trips when a row sets only
  the overdue threshold (credit_limit = 0).

Fixes #52960

* fix: compute overdue amount in company currency and format with fmt_money

get_customer_overdue_amount now sums GL Entry debit - credit grouped per
invoice, which is always booked in company currency, instead of using
get_outstanding_invoices which returns the receivable-account currency.
The threshold is in company currency, so the previous comparison could mix
currencies for customers with a foreign-currency receivable account. This
mirrors how get_customer_outstanding computes the figure for the existing
credit-limit check.

The blocking message now formats both amounts with fmt_money using the
company currency.

Adds a test asserting a 100 USD invoice at a conversion rate of 50 is
counted as 5000 in company currency.

* refactor: drop redundant threshold coercion and dead test cleanup

- Coerce the overdue threshold with flt() once when reading it, instead of
  calling flt() on it at each of the three use sites.
- Remove a no-op set_overdue_billing_threshold() call in the feature-disabled
  block (the threshold was already set to that value) and the trailing reset,
  which is dead since each test is rolled back.

No behaviour change.

* fix: compute overdue amount from payment terms, matching the Overdue status

The overdue amount keyed on Sales Invoice.due_date, which set_due_date() sets
to the LAST payment term. An invoice whose first term was past due and unpaid
was therefore counted as zero, even though ERPNext already shows it as Overdue
in the invoice list. The gate and the UI could disagree.

get_customer_overdue_amount now follows the same rule as is_overdue(): per
invoice, the amount that has fallen due (sum of payment schedule terms past
their due date) minus what has been paid, clamped to the outstanding balance.
Invoices without a schedule (POS, opening) still fall back to the invoice due
date, mirroring is_overdue()'s own guard.

The ledger stays the source of truth for what is unpaid: the outstanding per
invoice is still SUM(debit) - SUM(credit) from GL Entry. base_payment_amount is
always stored in company currency, so no currency conversion is needed and the
comparison against the threshold stays consistent.

Adds a test covering a two-term invoice: only the past-due term counts, and
paying it off clears the overdue amount.

* feat: honour the overdue billing threshold set on the customer group

The threshold lives on Customer Credit Limit, which is also rendered on
Customer Group. A threshold set there was stored but never evaluated, so the
configuration was a silent no-op.

get_overdue_billing_threshold now reads the customer's row and falls back to
its customer group, mirroring get_credit_limit. The group's
bypass_credit_limit_check is deliberately not consulted: it is labelled for the
credit limit check at sales order and is unrelated to overdue billing.

get_customer_group_details also dropped the threshold when copying group rows
onto a customer, because it copied a single hardcoded field per table. It now
copies a list of fields per table, so credit_limit and overdue_billing_threshold
both carry over.
2026-07-17 18:58:10 +05:30
rohitwaghchaure
40f861c0a0 fix: parallel reposting stalls between scheduler ticks (#57220) 2026-07-17 16:27:27 +05:30
Poovetha
7248961568 fix(projects): add project filter 2026-07-17 15:03:25 +05:30
Poovetha
79e5ccd370 test(projects): add test to ensure on hold project retains status 2026-07-17 15:03:25 +05:30
Poovetha
51a9fc0316 fix(projects): include on hold status in project filters and reports 2026-07-17 15:03:25 +05:30
Mihir Kandoi
3f53475cad Merge pull request #57233 from mihir-kandoi/fix-stock-entry-pending-work-order-query
fix: replace column-literal work order filter with server-side query
2026-07-17 14:05:05 +05:30
Mihir Kandoi
eed7c98b30 fix: replace column-literal work order filter with server-side query
The work_order link filter in Stock Entry passed the string
`tabWork Order`.produced_qty as a filter value. It was never a real
column comparison: db_query coerces string values on numeric fields
with flt(), so the condition silently degraded to qty > 0, and on
backends that don't coerce text to numeric (postgres) such filters
fail with InvalidTextRepresentation.

Move the condition into a whitelisted search query that compares the
columns properly (qty > produced_qty), mirroring pick_list's
get_pending_work_orders.
2026-07-17 13:54:08 +05:30
Mihir Kandoi
d8eb029284 Merge pull request #57228 from mihir-kandoi/fix-transit-warehouse-company-fallback
fix: fall back to the company in-transit warehouse
2026-07-17 13:06:54 +05:30
Mihir Kandoi
920e64ded0 fix: fall back to the company in-transit warehouse
set_transit_warehouse re-tested from_warehouse inside a guard that
already requires it, so the Company branch of its ternary was
unreachable: with no default on the source warehouse the field stayed
empty and Company.default_in_transit_warehouse was silently ignored.
Try the warehouse's default first, then the company's.
2026-07-17 13:05:29 +05:30
Diptanil Saha
9fdb6dd875 Merge pull request #57224 from diptanilsaha/fix/dunning_type_validation
fix: added missing validations for `Dunning Type`
2026-07-17 10:45:40 +05:30
diptanilsaha
2325068b19 test: added tests for Dunning Type validation 2026-07-17 10:35:10 +05:30
diptanilsaha
c8e7674d63 fix: added missing validations for Dunning Type 2026-07-17 10:35:04 +05:30
Mihir Kandoi
0cba26c608 Merge pull request #57225 from mihir-kandoi/fix-duplicate-workspace-links
fix: remove duplicate links from home and projects workspaces
2026-07-17 08:05:53 +05:30
Mihir Kandoi
7fc43aba72 fix: remove duplicate links from home and projects workspaces
Workspace re-export in #56864 duplicated every link in the Home and
Projects workspaces, so desk renders each link twice. Same issue as
55afd95b20. Bumped modified so existing sites re-sync.
2026-07-17 07:55:17 +05:30
Mihir Kandoi
fc50e23daa Merge pull request #57194 from aerele/fix-operation-batch-size-flag-n-plus-one
fix: batch operation batch-size flag lookups to avoid n+1 query in wo…
2026-07-17 07:47:59 +05:30
pandiyan
6500752440 fix: batch operation batch-size flag lookups to avoid n+1 query in work order operations 2026-07-16 23:35:45 +05:30
MochaMind
2b4fc02c81 fix: sync translations from crowdin (#57188) 2026-07-16 18:01:04 +02:00
Shllokkk
76298d9bee Merge pull request #57198 from Shllokkk/strip-account-number-coa-importer
fix: strip account number when building account name in COA importer
2026-07-16 20:50:58 +05:30
Nishka Gosalia
5fc03a116a feat: map settings for DocTypes to show on settings dialog (#57025)
fix: mapping settings for DocType settings
2026-07-16 19:30:27 +05:30
Diptanil Saha
ac68db3fa6 refactor(dunning): converted get_dunning_letter_text to doc method and restrict_globals on render_template (#57205) 2026-07-16 16:06:13 +05:30