Commit Graph

60366 Commits

Author SHA1 Message Date
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
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
Mihir Kandoi
3e15fe0dfd Merge pull request #57435 from aerele/fix-party-dashboard-user-permission
fix(accounts): respect user permissions in party dashboard company list
2026-07-24 15:00:00 +05:30
Deepesh Garg
a04725eb04 Merge pull request #57296 from deepeshgarg007/user_change
fix: Ignore permission while deleting user permission
2026-07-24 12:29:58 +05:30
pandiyan
903c87bcaa fix: respect user permissions in party dashboard company list
use frappe.get_list instead of frappe.get_all in get_dashboard_info so
the company list honors user permissions. previously, a party with
invoices across multiple companies would raise "User don't have
permissions to select/read this account" for users restricted to a
subset of companies, since get_party_account was called for companies
the user could not access.

fixes frappe/erpnext#57428
2026-07-24 12:22:08 +05:30
Deepesh Garg
314796633f Merge branch 'develop' into user_change 2026-07-24 12:14:34 +05:30
Khushi Rawat
5bf1c506a5 Merge pull request #57382 from khushi8112/fix/mt940-per-transaction-reference
fix: map MT940 per-transaction reference from :61: customer_reference
2026-07-24 10:36:35 +05:30
Mihir Kandoi
ba593f918a Merge pull request #57335 from aerele/fix/report-date-validation-dry
refactor: reuse shared date range validation across reports
2026-07-23 19:54:34 +05:30
Nabin Hait
50e361e10d Merge pull request #57263 from nabinhait/proforma-invoice
feat(selling): Proforma Invoice against Sales Order
2026-07-23 19:48:44 +05:30
Mihir Kandoi
e6ddb91ce5 Merge pull request #57410 from mihir-kandoi/revert-default-warehouse-names
revert: canonical default warehouse names (#57392, #57409)
2026-07-23 19:41:05 +05:30
Nabin Hait
0b71c943c1 fix(selling): don't email cancelled proformas or copy their PDF
Address review findings:
- send_proforma_email rejects non-issued proformas, and the tab suppresses the
  action for cancelled rows, so a voided document can't be sent to a customer
- mark proforma_pdf as no_copy and disable amendment (a proforma is created
  only from a Sales Order), so a copied proforma can't carry the original's PDF
  and number
2026-07-23 19:17:21 +05:30
Nabin Hait
e4fb5ed3c4 fix(selling): guard proforma against unsubmitted SO and missing PDF
Address review findings:
- make_proforma_invoice: reject a non-submitted Sales Order (the whitelisted
  endpoint was previously only JS-gated on docstatus)
- send_proforma_email: throw a clear error when the attached PDF File is missing
  instead of passing a null fid to sendmail
2026-07-23 18:59:08 +05:30
ervishnucs
170803b041 refactor: reuse shared date range validation across reports 2026-07-23 18:31:50 +05:30
Mihir Kandoi
e4561b1431 Merge pull request #57412 from aerele/customer-pick-list
fix: map pick list customer to delivery note when no sales order
2026-07-23 18:24:19 +05:30
Mihir Kandoi
bf309f65d4 Merge pull request #57413 from aerele/fix-batch-oldest-expiry-typeerror
fix: typeerror in get_batches_by_oldest for mixed batch expiry
2026-07-23 18:23:10 +05:30
pandiyan
62c9f8ee3e fix: typeerror in get_batches_by_oldest for mixed batch expiry
sort on (expiry is none, expiry) so a null expiry_date is never
order-compared against a datetime.date, which raised typeerror in
python 3 when a warehouse held both dated and never-expiring batches.
2026-07-23 17:48:22 +05:30
R-Jayaraman
aff10d3a37 fix: map pick list customer to delivery note when no sales order 2026-07-23 17:41:03 +05:30
Mihir Kandoi
63f6f1808f Revert "Merge pull request #57392 from mihir-kandoi/fix/canonical-default-warehouse-names"
This reverts commit 5fa242ec93, reversing
changes made to a81524ea14.
2026-07-23 17:09:53 +05:30
Mihir Kandoi
a8e74df6f7 Revert "Merge pull request #57409 from mihir-kandoi/chore/drop-warehouse-name-translation-marking"
This reverts commit ab16fd0a98, reversing
changes made to 5fa242ec93.
2026-07-23 17:09:53 +05:30
Mihir Kandoi
ab16fd0a98 Merge pull request #57409 from mihir-kandoi/chore/drop-warehouse-name-translation-marking
refactor: drop translation marking from default warehouse names
2026-07-23 16:56:50 +05:30
Mihir Kandoi
2ea63ce709 refactor: drop translation marking from default warehouse names
warehouse_name is a Data field shown as stored, and everywhere else
users see the docname, which carries the company abbr ("Stores - F")
and is never translated - a translated bare "Stores" has no display
use, so the identity _ marking from #57392 serves nothing. The
exists-guard keeps the runtime session-translation match that protects
legacy sites from duplicate English warehouses.
2026-07-23 16:45:57 +05:30
Mihir Kandoi
5fa242ec93 Merge pull request #57392 from mihir-kandoi/fix/canonical-default-warehouse-names
fix: create default warehouses with untranslated names
2026-07-23 16:17:04 +05:30
Mihir Kandoi
a81524ea14 Merge pull request #57400 from aerele/fix-address-missing-company-address-field
fix: guard against missing is_your_company_address custom field on ad…
2026-07-23 16:10:24 +05:30
Mihir Kandoi
2f008ea846 Merge pull request #57403 from mihir-kandoi/fix-stock-ageing-batch-pool-rebalance
fix: rebalance batch slot values at the pooled rate when driven negative
2026-07-23 16:09:19 +05:30
Mihir Kandoi
194e1df5cc fix: rebalance batch slot values at the pooled rate when driven negative
A batch is one valuation pool, so consumption is valued at the pooled
rate while slots may carry stale intra-batch detail (e.g. units
reconciled at zero and later merged). Consuming such a slot leaves a
negative value on positive qty. Spread the pool value across the
batch's slots when that happens; non-batchwise slots pool per
warehouse.
2026-07-23 15:56:42 +05:30
Mihir Kandoi
4911484349 Merge pull request #57399 from mihir-kandoi/production-plan-reserve-bom-qty
fix: Production Plan raw material qty calculation and bin reservation
2026-07-23 15:27:21 +05:30
Mihir Kandoi
a370c9a348 fix: AttributeError in sufficient sub assembly warning 2026-07-23 15:16:13 +05:30
Mihir Kandoi
276f69498a fix: safety stock and MOQ over-ordering in Production Plan raw materials 2026-07-23 15:16:11 +05:30
Mihir Kandoi
c0cb783603 fix: reserve full BOM consumption for Production Plan raw materials 2026-07-23 15:16:11 +05:30
Mihir Kandoi
9ec2262d09 Merge pull request #57398 from mihir-kandoi/item-group-get-root-of
refactor: use get_root_of for Item Group root resolution
2026-07-23 15:01:16 +05:30
Mihir Kandoi
3b3e7b5ea4 refactor: use get_root_of for Item Group root resolution
Replaces the hand-rolled parentless-group query from #57390 with the
framework helper, matching sibling tree doctypes like Customer Group.
2026-07-23 14:48:37 +05:30
Mihir Kandoi
da8bf368da Merge pull request #57387 from mihir-kandoi/drop-job-card-operation-row-number
refactor: drop unused operation_row_number field from Job Card
2026-07-23 14:42:07 +05:30
rohitwaghchaure
8c0ec3c179 fix: Incorrect creation time at the time cancelling an entry causing an issue especially same posting datetime (#57380)
* fix: shift same-timestamp sibling SLEs when cancelling an entry

update_qty_in_future_sle compared against the reversal SLE's own
creation and skipped same-posting_datetime siblings on cancel, leaving
their qty_after_transaction stale and causing false negative stock
errors.

* fix: revert update_qty_in_future_sle cancel tie-break, it double-counted
2026-07-23 09:07:33 +00:00
Mihir Kandoi
53ae349b5a Merge pull request #57390 from mihir-kandoi/fix-item-group-root-lookup
fix: do not translate root Item Group lookup key
2026-07-23 14:22:31 +05:30
Mihir Kandoi
002ca6d5c1 Merge pull request #57388 from mihir-kandoi/mapper-dict-target-doc
fix: accept dict target_doc in mapper endpoints
2026-07-23 14:22:06 +05:30
pandiyan
ea3ed8b836 fix: guard against missing is_your_company_address custom field on address 2026-07-23 14:06:23 +05:30
Mihir Kandoi
861c6b16be fix: create default warehouses with untranslated names
Company.create_default_warehouses stored warehouse_name through the
session _(), so a site set up in a non-English language keeps its
default warehouses under translated names. The opening-stock fallback
in item.py then looks up {"warehouse_name": _("Stores")} from an
arbitrary session and misses the warehouse whenever the lookup
session's language differs from the creation session's.

Create the default warehouses with canonical English names, matching
the identity-_ convention install_fixtures uses for other default
records. The exists-guard also matches the session translation so a
re-run on a legacy site does not insert English duplicates next to
translated warehouses.

The "Stores" fallback lookup moves to get_stores_warehouse, which
tries the canonical name first and falls back to the session
translation so legacy sites keep resolving their translated warehouse.
The setup-wizard and test-bootstrap lookups drop _() since they now
run after English creation (install_fixtures already used identity _,
so its lookup silently missed translated warehouses before this
change).

Same bug class as #57345.
2026-07-23 14:05:22 +05:30
Mihir Kandoi
d197d5685e fix: resolve Item Group tree root structurally
A name lookup misses roots created under a translated name (pre-#49875
setups) or renamed roots. Resolve the first parentless group by lft and
guard against self-parenting when the root itself is saved.
2026-07-23 14:03:54 +05:30
Shllokkk
f2496d2e2c fix: respect selected BOM when creating work order for variant item (#57358) 2026-07-23 13:49:34 +05:30
Mihir Kandoi
9c8d9ac42b fix: validate supplied operation_id belongs to work order operation 2026-07-23 13:23:15 +05:30
Mihir Kandoi
2551543703 fix: accept dict target_doc in mapper endpoints
Native JSON request bodies deliver target_doc as a parsed dict, which the
str | Document type hints rejected, breaking every Get Items From button.
Unify all whitelisted mapper endpoint hints to str | dict | Document | None.
Needs frappe#41190 so get_mapped_doc converts the dict target.
2026-07-23 13:20:40 +05:30
Mihir Kandoi
553336fa6f fix: resolve or require operation_id server-side 2026-07-23 13:17:49 +05:30
Mihir Kandoi
7239e6ed8c fix: do not translate root Item Group lookup key
_("All Item Groups") resolves in the session language, so for
non-English users the db.exists lookup missed the root (stored in
English) and new groups were saved parentless, becoming uneditable
second roots.

Closes #57345
2026-07-23 13:17:48 +05:30
Mihir Kandoi
cff05687d9 Merge pull request #57389 from mihir-kandoi/fix/translated-default-record-lookups
fix: do not translate default record lookup keys
2026-07-23 13:06:35 +05:30
Mihir Kandoi
50de87c9ea fix: clear stale operation_id and guard async row selection 2026-07-23 13:00:10 +05:30
Mihir Kandoi
8cd36f60ab fix: prompt for operation row when operation repeats in work order 2026-07-23 12:52:27 +05:30
Mihir Kandoi
9b7c36f3d9 fix: do not translate default record lookup keys
Company.create_default_departments named and looked up the root
Department via _("All Departments"), which resolves in the session
language. A site set up in a non-English language stores the root
translated, and a company created later from a session in another
language misses it and inserts a second root, corrupting the tree.
Resolve the root once with get_root_of (falling back to the canonical
English name on fresh installs) and reuse it for the root record, the
exists-guard and the child departments' parent.

Also stop translating lookups of records install_fixtures stores under
English names: Price List "Standard Selling" and Print Headings
"Credit Note" / "Debit Note".

Same class as the root Item Group fix (#57386, issue #57345).
2026-07-23 12:51:30 +05:30
Mihir Kandoi
c93b63d757 Merge pull request #57383 from mihir-kandoi/company-restriction-permlevel
fix: gate company restriction fields behind permlevel 1
2026-07-23 12:40:16 +05:30
Mihir Kandoi
d71681a99e refactor: drop unused operation_row_number field from Job Card 2026-07-23 12:37:29 +05:30
Mihir Kandoi
92b62402be Merge pull request #57384 from pratheep-bit/fix/fr-corr-001-reorder-item
fix: log exception instead of swallowing in notify_errors
2026-07-23 12:34:24 +05:30