Commit Graph

58997 Commits

Author SHA1 Message Date
Vishnu Priya Baskaran
41cee6e71b fix(stock): carry accounting dimensions from Landed Cost Voucher char… (#56981)
* fix(stock): carry accounting dimensions from Landed Cost Voucher charges into GL entries

* feat(stock): add accounting dimension fields to Landed Cost Taxes and Charges

The charge row had no dimension fields, so a dimension marked mandatory for
Profit and Loss accounts could not be supplied anywhere on the voucher.

Add the accounting dimensions section, cost center and project, and register
the doctype in accounting_dimension_doctypes so custom dimension fields are
created on it. The section and column break are required for that hook to
place the generated fields correctly.

Cost center deliberately omits the ":Company" default used by Purchase Taxes
and Charges: this child table is also the additional costs table on Stock
Entry and Subcontracting Receipt, and auto-filling it there would change
existing postings.

* refactor(stock): group landed cost charges by expense account and dimensions

get_item_account_wise_lcv_entries keyed its inner map by expense account
alone, so two charge rows posting to the same account - whether in one voucher
or across vouchers - were merged. Amounts accumulated correctly but any
per-row context was lost to whichever row was seen first.

Key the grouping by (expense account, dimension values) and return a list of
charges per receipt item, each carrying its own dimensions, so rows that
differ only by dimension stay distinct.

Dimensions resolve from the charge row first, then the voucher item row.
Blanks are left blank so the GL composers can fall back to the receipt item
and receipt document as before.

* refactor(accounts): allow explicit accounting dimensions on add_gl_entry

get_gl_dict derives dimensions from the parent document and the item row, and
reads only custom dimensions off the item - never cost center or project.
Callers that need to set a dimension from some other source had no way to do
so except by building the args dict by hand.

Add a dimensions argument that is merged into the entry before get_gl_dict is
called, and thread it through the StockController and BaseGLComposer wrappers.

* fix(stock): carry landed cost charge dimensions onto the GL entries

Landed cost charges are posted into the receipt document's ledger, and their
expense account is a Profit and Loss account. Until now the entry took its
dimensions from the receipt item, which cannot know about a voucher created
after it was submitted, so a dimension mandatory for P&L accounts failed.

Take cost center, project and custom dimensions from the charge row, falling
back to the receipt item and receipt document when the row leaves them blank.
Only the leg posting to the charge account is affected; the reclass leg keeps
the item's dimensions so it still nets against the base item entry.

Also skip charges that prorate to zero, and hoist the landed cost lookup in
the Purchase Receipt composer out of the item loop - it was reloading every
voucher once per item.

* fix(stock): report missing mandatory dimensions on the Landed Cost Voucher row

Submitting a voucher re-makes the receipt document's GL entries, so a missing
mandatory dimension surfaced as a GL Entry error naming an account, raised
from the middle of update_landed_cost, with nothing pointing at the row that
caused it.

Check the charge rows during validate instead, against both the mandatory
for P&L / Balance Sheet flags and the per-account Accounting Dimension Filter,
and name the row, the dimension and the account in the message.

The check resolves values through the same fallback chain the GL composers
use, so it does not reject a voucher that would have posted successfully.

* test(stock): cover accounting dimensions on landed cost vouchers

Covers the charge row reaching the GL entry, cost center and project
overriding the receipt item, the blank row still falling back to it, and two
charge rows - and two vouchers - on the same expense account with different
dimensions staying separate entries.

Also covers the mandatory P&L dimension being satisfied from the charge row,
the missing one being reported on the voucher, dimensions surviving a repost,
and each dimension netting to zero on cancellation.

* refactor(lcv): apply custom dimension overrides via .update()

---------

Co-authored-by: nareshkannasln <nareshkannashanmugam@gmail.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit 918e5a28db)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/services/gl_composer.py
#	erpnext/accounts/services/base_gl_composer.py
#	erpnext/controllers/stock_controller.py
#	erpnext/patches.txt
#	erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
#	erpnext/stock/doctype/purchase_receipt/services/gl_composer.py
#	erpnext/stock/doctype/stock_entry/services/gl_composer.py
#	erpnext/subcontracting/doctype/subcontracting_receipt/services/gl_composer.py
2026-08-26 05:58:07 +00:00
Shllokkk
7238ecb306 Merge pull request #58407 from frappe/mergify/bp/version-16-hotfix/pr-58400
fix: send auto reorder email to all managers in single company setup (backport #58400)
2026-08-25 18:30:12 +05:30
Shllokkk
97b2e07d5e test: auto reorder email reaches managers without company user permission
(cherry picked from commit a01cc92184)
2026-08-25 12:08:44 +00:00
Shllokkk
ac1c6921da fix: send auto reorder email to all managers in single company setup
(cherry picked from commit ae119b1c29)
2026-08-25 12:08:43 +00:00
Sudharsanan Ashok
c9550023f8 Merge pull request #58399 from frappe/mergify/bp/version-16-hotfix/pr-58395
fix: respect zero currency precision (backport #58395)
2026-08-25 16:45:34 +05:30
Pandiyan P
6b61146d2f fix: respect zero currency precision (#58395)
(cherry picked from commit ce23fcc055)
2026-08-25 10:06:39 +00:00
Sudharsanan Ashok
9209912374 Merge pull request #58353 from frappe/mergify/bp/version-16-hotfix/pr-58179
fix(accounts): supplier group filter not applied on accounts payable … (backport #58179)
2026-08-25 13:04:52 +05:30
Sudharsanan Ashok
f1181fa1e3 Merge pull request #58391 from frappe/mergify/bp/version-16-hotfix/pr-58362
fix(stock): reset bin when no stock ledger entries remain (backport #58362)
2026-08-25 12:46:31 +05:30
Sudharsanan Ashok
37a1fd11e9 fix(stock): reset bin when no stock ledger entries remain (#58362)
* fix(stock): reset bin when no stock ledger entries remain

update_bin() only writes bins reachable through prev_sle_dict, and that
dict is empty once the last live sle for an item and warehouse is
cancelled or deleted. actual_qty is still recomputed, but stock_value
and valuation_rate stay stale and a repost cannot heal them, so bin
totals drift permanently from the stock balance.

zero those bins after the normal update, guarded by a re-check that no
live sle exists. also drop the prev_sle_dict seeding added earlier in
initialize_previous_data, which never took effect because
initialize_reposting() discards the dict before update_bin() reads it.

* test(stock): cover bin reset when ledger is empty

three cases that all leave an item and warehouse with no live sle:
cancelling the only voucher, deleting it with delete_linked_ledger_entries
on, and reposting over an already emptied ledger. each asserts actual_qty,
valuation_rate and stock_value are all zero.

(cherry picked from commit 6fbcfade6c)
2026-08-25 06:10:18 +00:00
Sudharsanan Ashok
f71bc4d3ef Merge pull request #58384 from aerele/backport-58377-version-16-hotfix
fix: prevent duplicate supplier quotations from portal (backport #58377)
2026-08-25 11:12:10 +05:30
pandiyan
efe5571ca7 test: verify duplicate supplier quotations are rejected 2026-08-24 23:57:59 +05:30
pandiyan
39e15c7b2d fix: prevent duplicate supplier quotations from portal 2026-08-24 23:57:59 +05:30
mergify[bot]
2329ef6424 fix: hide supplier name in rfq portal (backport #58373) (#58376)
Co-authored-by: Pandiyan P <pandiyanpalani37@gmail.com>
2026-08-24 12:11:31 +00:00
mergify[bot]
83cc51a5d2 Fix/return qty validation different uom (backport #58298) (#58364)
Co-authored-by: Vishnu Priya Baskaran <145791817+ervishnucs@users.noreply.github.com>
Co-authored-by: Afsal Syed <afsalsyed12@gmail.com>
2026-08-24 17:39:41 +05:30
mergify[bot]
feb51a475a fix(italy): handle none price_list_rate in e-invoice xml generation (backport #58242) (#58370)
Co-authored-by: Vishnu Priya Baskaran <145791817+ervishnucs@users.noreply.github.com>
2026-08-24 17:39:16 +05:30
mergify[bot]
5933476778 fix: filter available batch report by company (backport #57995) (#58077)
Co-authored-by: Krishna Shirsath <shirsathkrishna19@gmail.com>
2026-08-24 11:19:45 +00:00
Sudharsanan Ashok
fb9edb3bf8 Merge pull request #58361 from frappe/mergify/bp/version-16-hotfix/pr-58358
fix: render missing terms before printing (backport #58358)
2026-08-24 16:37:06 +05:30
Sudharsanan Ashok
9d9d9f09fd Merge pull request #58372 from frappe/mergify/bp/version-16-hotfix/pr-58368
fix: hide rfq status in supplier portal (backport #58368)
2026-08-24 16:36:08 +05:30
Pandiyan P
8a2109e62a fix: hide rfq status in supplier portal (#58368)
(cherry picked from commit 75d6183bb6)
2026-08-24 11:00:24 +00:00
mergify[bot]
abe4c0a6b7 fix: aggregate child warehouses in Stock Qty vs Serial No Count report (backport #58134) (#58366)
Co-authored-by: Mohd Haris <haris@frappe.io>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-24 10:24:40 +00:00
Pandiyan P
f56cdac45f fix: render missing terms before printing (#58358)
(cherry picked from commit 59d80b29c4)
2026-08-24 09:24:08 +00:00
mergify[bot]
0bf34c054a fix: include time logs ending at midnight in timesheet billing summary (backport #58355) (#58357)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-24 14:46:46 +05:30
ervishnucs
d23b9197d5 fix(accounts): supplier group filter not applied on accounts payable report
(cherry picked from commit 513f19924d)
2026-08-24 07:09:12 +00:00
mergify[bot]
8dbe4bd7fa ci: bump po-review-action (backport #58346) (#58348)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2026-08-23 18:22:37 +00:00
MochaMind
d321eb4a8a chore: update POT file (#58344) 2026-08-23 13:33:34 +02:00
Mihir Kandoi
a1520d06ee chore: rename type field to secondary_item_type (backport #55469) (#58342) 2026-08-23 14:07:59 +05:30
mergify[bot]
647c93321b fix(projects): respect permissions in timesheet billing summary (backport #58320) (#58322)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-20 15:48:55 +05:30
mergify[bot]
2077e844d4 fix: correct to and from date filters in timesheet billing summary re… (backport #58317) (#58318)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-20 11:13:42 +05:30
mergify[bot]
c3313f5b34 fix: stop doubling totals in timesheet billing summary (backport #58311) (#58315)
Co-authored-by: Pandiyan P <pandiyanpalani37@gmail.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-20 03:03:06 +00:00
Pandiyan P
dfc2301f08 fix: skip covered rows when ordering from the mrp report (#58249) (#58312) 2026-08-20 07:43:16 +05:30
mergify[bot]
53b61e5ac6 fix(stock): preserve item UOM conversion factor (backport #58299) (#58304)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-19 12:01:42 +00:00
mergify[bot]
a3a6efbcea fix: keep Currency and Price List section open for foreign currency (backport #58074) (#58113)
* fix: keep Currency and Price List section open for foreign currency (#58074)

The section is marked collapsible with no condition, so it always
rendered collapsed. When the transaction currency differs from the
company currency the exchange rate is relevant and was hidden behind
a click.

Adds collapsible_depends_on so the section starts expanded whenever
the transaction currency differs from the company currency, and stays
collapsed otherwise.

(cherry picked from commit 4a8342496e)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/pos_invoice.json
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json
#	erpnext/stock/doctype/delivery_note/delivery_note.json

* fix: resolve unresolved cherry-pick conflict markers in modified timestamps

Mergify's automatic cherry-pick of #58074 left conflict markers
committed on the modified field, breaking JSON parsing.

---------

Co-authored-by: Jatin3128 <140256508+Jatin3128@users.noreply.github.com>
Co-authored-by: Jatin3128 <jatinsarna8@gmail.com>
2026-08-19 16:59:07 +05:30
mergify[bot]
9f99ba6ddc fix: block disabled/frozen party on Opportunity and Request for Quotation (backport #57983) (#58035)
* fix: block disabled/frozen customers on Opportunity

Opportunity inherits TransactionBase instead of AccountsController, so
it never ran validate_party_frozen_disabled like Quotation, Sales Order
and Sales Invoice do. A disabled Customer could be saved as an
Opportunity's party and only get caught later at Quotation stage.

Also fixes the party_name Link query on the client: it referenced
erpnext.queries.customer, which was never defined, so disabled
customers showed up in the picker.

(cherry picked from commit 90937ce6d9)

* fix: block disabled/frozen suppliers on Request for Quotation

Request for Quotation overrides validate() entirely and never calls
super().validate(), so it never goes through AccountsController's
party validation. Suppliers also sit in a child table, so the shared
PartyValidator wouldn't have caught it anyway (it only checks a single
top-level party field). A disabled or frozen Supplier could be added
to an RFQ and the RFQ submitted without any warning.

Also filters the suppliers grid's supplier Link field to disabled=0,
matching the same client-side fix applied to Opportunity's party_name.

(cherry picked from commit 4bf65ffc1d)

# Conflicts:
#	erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
#	erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py

* fix: scope Opportunity party validation to Customer only

validate_party_frozen_disabled only enforces Customer/Supplier/Employee,
so passing opportunity_from straight through silently no-op'd for Lead
and Prospect. Made the Customer-only scope explicit instead of relying
on that implicit fallthrough.

Lead.disabled is not enforced anywhere else in the codebase (lead_query,
the picker used for this same field, only filters status/docstatus), so
deliberately not extending validation to Lead-sourced Opportunities.

(cherry picked from commit 8c0a945417)

* refactor: move RFQ supplier disabled filter to link_filters

Static filters with no doc-dependent values belong on the field
definition, not in JS. Matches the existing pattern used for
Warehouse/Item link_filters elsewhere (e.g. job_card_item.json,
product_bundle_item.json).

(cherry picked from commit 6b35c51ff1)

* fix: resolve backport conflicts for disabled/frozen party validation

The automated backport left unresolved merge conflict markers committed
in request_for_quotation.py and test_request_for_quotation.py.

Dropped test_duplicate_supplier_rejected, test_rfq_blocked_for_supplier_with_prevent_rfqs
and test_rfq_status_lifecycle from the conflict resolution, they don't exist on
this branch and aren't part of this backport.

---------

Co-authored-by: Jatin3128 <jatinsarna8@gmail.com>
2026-08-19 16:57:42 +05:30
mergify[bot]
1f21c0b0af fix(stock): fetch item stock UOM in stock reconciliation (backport #58284) (#58291)
Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-19 10:09:44 +00:00
Khushi Rawat
f813774f63 Merge pull request #57771 from frappe/mergify/bp/version-16-hotfix/pr-57539
fix: prevent TimestampMismatchError resolving Dunning with multiple overdue installments (backport #57539)
2026-08-19 15:05:36 +05:30
mergify[bot]
98d69b2ae3 fix: Ignore permission while deleting user permission (backport #57296) (#57760)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2026-08-19 14:49:33 +05:30
mergify[bot]
29f6a5b9cf fix(selling): read overdue amount from payment ledger, not gl tags (backport #57786) (#58026)
Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com>
2026-08-19 14:41:47 +05:30
mergify[bot]
edb9b33264 fix: new docs should refetch incoming rates (backport #58097) (#58295)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-19 07:19:06 +00:00
mergify[bot]
94b6622d9d fix: use user data fields hook (backport #58274) (#58283)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-19 10:25:55 +05:30
mergify[bot]
d3573105c4 fix: escape interpolated values in text positions across portal and desk templates (backport #58286) (#58288) 2026-08-19 02:43:18 +05:30
mergify[bot]
9e2173e4c2 fix: escape on status image for workstations in production status (backport #58279) (#58281)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-08-19 00:17:17 +05:30
mergify[bot]
6b7b4796b4 fix: escape interpolated values in portal, print and desk templates (backport #58273) (#58278)
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2026-08-19 00:16:52 +05:30
rohitwaghchaure
27a04d8e08 fix: work order finish dialog with process loss qty from job card (backport #58256) (#58262)
* fix(manufacturing): cap job card completed qty by previous operation and show process loss on finish dialog

* fix: avoid double booking process loss on partial manufacture entries
2026-08-18 09:47:32 +00:00
mergify[bot]
9b0db26c25 fix(accounts): match returns to source invoice items (backport #58250) (#58264)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-18 09:08:31 +00:00
mergify[bot]
a62a949b2a fix(accounts): allocate drop-ship cost by invoice quantity (backport #58226) (#58263)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2026-08-18 08:41:58 +00:00
rohitwaghchaure
dd4d10862d fix: don't set work order status to In Process only due to skip material transfer (#58245) 2026-08-17 18:28:46 +05:30
Pandiyan P
861fb26b2c fix(manufacturing): fall back to item group defaults for work order w… (#58237) 2026-08-17 15:26:15 +05:30
mergify[bot]
56ac87292f fix: correct Item Group doctype name in item tax template dashboard (backport #58192) (#58213)
Co-authored-by: Pandiyan P <pandiyanpalani37@gmail.com>
2026-08-17 10:52:42 +05:30
mergify[bot]
81461ea56c fix(bank_statement_import): add missing permission check on multiple whitelisted methods (backport #58221) (#58224)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-08-16 18:03:24 +00:00
mergify[bot]
2b685ed982 fix(bank_statement_import): add missing permission check on get_import_status (backport #58217) (#58219)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2026-08-16 15:04:21 +00:00