60904 Commits

Author SHA1 Message Date
Nabin Hait
67ac8f64e8 test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:27:14 +05:30
Nabin Hait
79bd6a9b7d test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:27:09 +05:30
Nabin Hait
9158d5f893 test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:27:04 +05:30
Nabin Hait
2aff857561 test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:27:00 +05:30
Nabin Hait
7da4bc46bf test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:54 +05:30
Nabin Hait
851dfb16be test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:48 +05:30
Nabin Hait
abb7fec598 test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:41 +05:30
Nabin Hait
04617b40b4 test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:37 +05:30
Nabin Hait
78de0c976a test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:32 +05:30
Nabin Hait
0e6f50ca24 test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:28 +05:30
Nabin Hait
6ceddd7a83 test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:24 +05:30
Nabin Hait
364250467f test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:19 +05:30
Nabin Hait
f2d64d1a2a test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:14 +05:30
Nabin Hait
293ca4e96f test: reuse BootStrapTestData master data to reduce runtime
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:26:08 +05:30
Mihir Kandoi
05e44ca63a Merge pull request #56546 from mihir-kandoi/pg-rawsql-to-orm
refactor: convert convertible raw frappe.db.sql to ORM
2026-06-26 12:21:25 +05:30
Mihir Kandoi
0583349ae4 test: convert aggregate/pluck/positional raw SQL to ORM
A deeper re-audit (with an adversarial skeptic) of the queries left raw
in the prior commit found more that have exact ORM equivalents:

- scalar SUM/MAX  -> frappe.qb + Sum/Max .run()[0][0]
- SUM ... GROUP BY -> frappe.qb .groupby().select(Sum().as_()) run(as_dict)
- name IN (values) -> get_all(filters={'f': ['in', ...]})
- sql_list(select col) -> get_all(pluck='col')
- bulk UPDATE ... = NULL/value -> frappe.db.set_value(filters, field, val)
- positional as_list reads -> get_all(..., as_list=True) (+ sorted())

Note: get_value(dt, filters, 'sum(x)') and get_all(fields=['sum(x)'])
are rejected by frappe ('SQL functions are not allowed as strings'), so
aggregates go through frappe.qb. get_all(as_list=True) returns a tuple
(not a list), so consumers that mutate use sorted().

All affected test modules pass on MariaDB.
2026-06-26 11:34:31 +05:30
Mihir Kandoi
0776f7f7fa test: convert trivially-equivalent raw SQL to ORM helpers
Convert test-only raw frappe.db.sql calls that have an exact ORM
equivalent: full-table/filtered deletes -> frappe.db.delete, count ->
frappe.db.count, row-existence assertions -> frappe.db.exists,
single-row scalar fetches -> frappe.db.get_value, and simple
equality/range-filter selects -> frappe.get_all. No behaviour change.

Raw SQL that genuinely needs it is left as-is (dynamic identifiers,
aggregates/group-by, positional as_list consumers, DB-catalog
introspection).
2026-06-26 10:44:17 +05:30
Mihir Kandoi
0e54e532ff refactor(accounts): use frappe.get_all for trial balance account fetch
The Account metadata fetch in the DuckDB trial-balance path is a plain
static SELECT (fixed columns, single company filter, order by lft).
Convert it to frappe.get_all. Verified on Postgres: identical 98 rows,
same order and same dict payload as the raw query.
2026-06-26 10:44:05 +05:30
Nabin Hait
de45ab7fc9 test: add coverage for Incorrect Stock Value Report report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:40:32 +05:30
Nabin Hait
403788324a test: add coverage for Stock and Account Value Comparison report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:40:24 +05:30
Nabin Hait
6e23e49f23 test: add coverage for Landed Cost Report report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:40:16 +05:30
Nabin Hait
6595a32d90 test: add coverage for COGS By Item Group report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:40:07 +05:30
Nabin Hait
5ad8ea3f17 test: add coverage for Item Where Used report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:39:59 +05:30
Nabin Hait
2092909f21 test: add coverage for Serial No and Batch Traceability report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:39:51 +05:30
Nabin Hait
b537e8b183 test: add coverage for Delayed Order Report report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:33:20 +05:30
Nabin Hait
ce5239132c test: add coverage for Delayed Item Report report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:33:12 +05:30
Nabin Hait
8bef2b13a1 test: add coverage for Batch Item Expiry Status report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:33:05 +05:30
Nabin Hait
c69077cd3a test: add coverage for BOM Search report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:32:58 +05:30
Nabin Hait
25bcd12e92 test: add coverage for Delivery Note Trends report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:32:51 +05:30
Nabin Hait
68330843d8 test: add coverage for Purchase Receipt Trends report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:32:43 +05:30
Nabin Hait
4a6b189221 test: add coverage for Item Variant Details report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:25:55 +05:30
Nabin Hait
993578dc2f test: add coverage for Itemwise Recommended Reorder Level report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:25:48 +05:30
Nabin Hait
08ce18fe58 test: add coverage for Item Price Stock report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:25:40 +05:30
Nabin Hait
6d97a5d543 test: add coverage for Item Prices report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:25:33 +05:30
Nabin Hait
495677ceb7 test: add coverage for Warehouse Wise Item Balance Age and Value report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:25:26 +05:30
Nabin Hait
7661e5ed96 test: add coverage for Serial No Ledger report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:25:18 +05:30
Nabin Hait
dddaa80f99 test: add coverage for Serial and Batch Summary report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:25:11 +05:30
Nabin Hait
b5405a02cc test: add coverage for Stock Qty vs Serial No Count report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:20:22 +05:30
Nabin Hait
655dea37dd test: add coverage for Stock Qty vs Batch Qty report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:20:15 +05:30
Nabin Hait
e9d4e2cedd test: add coverage for Stock Ledger Variance report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:20:07 +05:30
Nabin Hait
09be6fed9a test: add coverage for Stock Ledger Invariant Check report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:59 +05:30
Nabin Hait
ddb07bcc0a test: add coverage for Negative Batch Report report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:52 +05:30
Nabin Hait
06592a49c8 test: add coverage for Incorrect Serial No Valuation report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:45 +05:30
Nabin Hait
047014f2b5 test: add coverage for Incorrect Serial and Batch Bundle report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:38 +05:30
Nabin Hait
7c8ef4cfc6 test: add coverage for Incorrect Balance Qty After Transaction report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:31 +05:30
Nabin Hait
ec739b213d test: add coverage for FIFO Queue vs Qty After Transaction Comparison report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:24 +05:30
Nabin Hait
119e0caafb test: add coverage for Item-wise Consumption report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:17 +05:30
Nabin Hait
752aefbdfd test: add coverage for Product Bundle Balance report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:11 +05:30
Nabin Hait
5790bcf99d test: add coverage for Batch-Wise Balance History report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:19:04 +05:30
Nabin Hait
3c749ec785 test: add coverage for Total Stock Summary report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:18:57 +05:30