Commit Graph

59267 Commits

Author SHA1 Message Date
ruthra kumar
6b4895bcc9 feat(general-ledger): implement execute_synced_report with full parity to normal report
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:01:32 +05:30
ruthra kumar
f40cd41801 refactor: DB agnostic method names 2026-06-25 11:01:32 +05:30
ruthra kumar
5c536b8ad1 refactor: maintain sync dependency in report master 2026-06-25 11:01:32 +05:30
ruthra kumar
55862f98f4 refactor(trial-balance): execute_duckdb only reads GL Entry from duckdb
Replaces the previous over-engineered stub with 7 short functions.
Account data, Account Closing Balance, and all metadata come from
frappe.db as normal; only tabGL Entry is read from the duckdb_conn.

Reuses get_opening_balance() for Account Closing Balance unchanged,
reuses all downstream compute helpers (calculate_values, prepare_data,
etc.) unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:01:32 +05:30
ruthra kumar
b1c8e2cb5c feat(trial-balance): implement execute_duckdb with full parity to normal report
Replaces the placeholder stub with 8 focused functions that mirror the
normal execute() flow using parameterized DuckDB SQL queries: account
fetch, period GL entries, opening balances (with Period Closing Voucher
path), and all filters (cost center, project, finance book, accounting
dimensions). Reuses existing pure-Python processing functions unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:01:32 +05:30
ruthra kumar
adb768505a refactor: reports on duckdb 2026-06-25 11:01:32 +05:30
Mihir Kandoi
fcfaa8843b Merge pull request #56439 from mihir-kandoi/migrate-request-type-json
fix!: switch ERPNext to JSON request body (use_json_request_body)
2026-06-24 22:37:59 +05:30
Mihir Kandoi
3be80d8e87 fix: include list in get_events filters type hint
The calendar view sends filters as a list of [doctype, field, op, value]
conditions (filter_area.get()); get_filter_conditions_qb accepts dict or list.
2026-06-24 22:01:55 +05:30
Mihir Kandoi
f034bb55d3 fix: correct process_genericode_import filters hint to str | dict | None
import_genericode consumes filters via (filters or {}).items(), so it is a
dict, not a list.
2026-06-24 22:01:55 +05:30
Mihir Kandoi
71b4cc4f12 refactor: drop dead except TypeError in add_bank_accounts
frappe.parse_json never raises TypeError (unlike json.loads on a non-str),
so the try/except guarding the parse is now unreachable.
2026-06-24 20:55:01 +05:30
Mihir Kandoi
6a4afd1733 fix: parse native JSON contacts args in CRM prospect/customer endpoints
create_prospect_against_crm_deal and create_customer read `contacts`
from form_dict (json.loads(doc.contacts) / customer_data.get("contacts")),
which arrives as a native list under JSON body mode. Use frappe.parse_json.
2026-06-24 20:55:01 +05:30
Mihir Kandoi
3fa7ec656b fix: parse native JSON schedules arg in make_payment_request
make_payment_request(**args) is whitelisted and the client passes
`schedules` as a list, so json.loads(args.get("schedules")) raised
TypeError under JSON body mode. Use frappe.parse_json.
2026-06-24 20:55:01 +05:30
Mihir Kandoi
8854f0c153 feat!: send ERPNext requests as native JSON (use_json_request_body)
Opt ERPNext into native application/json request bodies (frappe#40237).
Non-GET requests to erpnext.* endpoints now send args as a JSON body
instead of form-encoded, per-key JSON-stringified values. Safe after the
preceding commits hardened every whitelisted endpoint with frappe.parse_json.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
9955adb2fc refactor: parse native JSON request args in www/book_appointment/index.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
785c34e0ad refactor: parse native JSON request args in utilities/query.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
7e8965c6be refactor: parse native JSON request args in utilities/bulk_transaction.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
7cbebc0545 refactor: parse native JSON request args in support/doctype/issue/issue.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
b3526db643 refactor: parse native JSON request args in stock/utils.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
f707da40ec refactor: parse native JSON request args in stock/report/stock_qty_vs_batch_qty/stock_qty_vs_batch_qty.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
cb2679ba2c refactor: parse native JSON request args in stock/get_item_details.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
a6ede74b2d refactor: parse native JSON request args in stock/doctype/warehouse/warehouse.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
5aeb711f69 refactor: parse native JSON request args in stock/doctype/stock_reconciliation/stock_reconciliation.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
9506a9d62a refactor: parse native JSON request args in stock/doctype/stock_entry/stock_entry.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
63a1b7d8e5 refactor: parse native JSON request args in stock/doctype/stock_entry/services/subcontracting.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
f5bf9392a0 refactor: parse native JSON request args in stock/doctype/stock_entry/services/manufacturing.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
ddd57ca12e refactor: parse native JSON request args in stock/doctype/serial_no/serial_no.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
2c7cea2879 refactor: parse native JSON request args in stock/doctype/repost_item_valuation/repost_item_valuation.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
8ca2e99cf2 refactor: parse native JSON request args in stock/doctype/putaway_rule/putaway_rule.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
a11eb741e5 refactor: parse native JSON request args in stock/doctype/purchase_receipt/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:35 +05:30
Mihir Kandoi
487aff80e0 refactor: parse native JSON request args in stock/doctype/pick_list/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
68e92a893a refactor: parse native JSON request args in stock/doctype/packed_item/packed_item.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
ccd115e769 refactor: parse native JSON request args in stock/doctype/material_request/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
5a77df6560 refactor: parse native JSON request args in stock/doctype/delivery_note/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
04a93cabf1 refactor: parse native JSON request args in stock/doctype/batch/batch.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
460b8c5d8d refactor: parse native JSON request args in setup/doctype/terms_and_conditions/terms_and_conditions.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
76705dd736 refactor: parse native JSON request args in setup/doctype/holiday_list/holiday_list.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
78f38970c1 refactor: parse native JSON request args in setup/doctype/department/department.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
8dd05ca056 refactor: parse native JSON request args in selling/page/point_of_sale/point_of_sale.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
f4df5ee0bc refactor: parse native JSON request args in selling/doctype/sales_order/sales_order.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
517f97ff73 refactor: parse native JSON request args in selling/doctype/sales_order/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
bf30b58d02 refactor: parse native JSON request args in selling/doctype/quotation/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
5543577ca7 refactor: parse native JSON request args in selling/doctype/customer/customer.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
7835cbaa56 refactor: parse native JSON request args in regional/report/irs_1099/irs_1099.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
cd8b740cb3 refactor: parse native JSON request args in regional/italy/utils.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:34 +05:30
Mihir Kandoi
cb236dedfc refactor: parse native JSON request args in projects/doctype/timesheet/timesheet.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:33 +05:30
Mihir Kandoi
5629f81809 refactor: parse native JSON request args in projects/doctype/task/task.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:33 +05:30
Mihir Kandoi
e432f8284b refactor: parse native JSON request args in projects/doctype/project/project.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:33 +05:30
Mihir Kandoi
c1ec503858 refactor: parse native JSON request args in manufacturing/doctype/work_order/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:33 +05:30
Mihir Kandoi
e14719b0ad refactor: parse native JSON request args in manufacturing/doctype/production_plan/services/planning_queries.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:33 +05:30
Mihir Kandoi
3946bf5366 refactor: parse native JSON request args in manufacturing/doctype/production_plan/services/material_request.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
2026-06-24 20:37:33 +05:30