Commit graph

362 commits

Author SHA1 Message Date
Kaushal Shriwas
e4e1c4af55 refactor: better naming and move variable inside the scope 2026-04-30 16:37:31 +05:30
Kaushal Shriwas
eb76248c99 refactor: extract non-labelable fieldtypes to constant 2026-04-30 15:24:38 +05:30
Kaushal Shriwas
ede2dea043 fix(report): skip total row label for datetime/time first column 2026-04-30 13:20:16 +05:30
Abdeali Chharchhodawala
690826ff9b
feat!: faster generation and formatting utils for excel exports (#36323)
* feat: Style builder for report xlsx formatting

* fix: update report to use direct import for query report execution

* refactor: simplify module method retrieval in report execution

* feat: get xlsx styles for report

* refactor: enhance XLSXStyleBuilder with currency formatting and default style registration

* feat: add xlsxwriter dependency for enhanced XLSX report generation

* refactor: enhance XLSXStyleBuilder with improved style registration and formatting methods

* feat: enhance XLSX export functionality with improved styling and metadata support

* refactor: default formatting of currency

* chore: remove some typo

* feat: update make_xlsx function to use xlsxwriter for improved Excel file generation and styling

* perf: some micro optimisations

* refactor: inline generator back and improve condition

* refactor: replace frappe.request_cache with functools.cache

* fix: handle styling in email

* fix: fix old test case to handle styles in export

* refactor: enhance XLSX style handling and registration methods

* refactor: improve currency formatting logic

* fix: update make_xlsx to use constant_memory for large datasets and improve row style handling

* fix: handle None style_id in XLSXStyleBuilder methods to prevent errors

* fix: include owner field with proper doctype naming

* fix: set default date format in XLSX workbook creation

* fix: pass applied filters to metadata

* fix: getting accurate field info for report view exporting

* chore: Minor changes

* feat: add function to generate default XLSX styles for exports

* feat: integrate default XLSX styles into builder report export functionality

* feat: styles on export docs xlsx

* feat: enhance make_xlsx function to support file path saving

* feat: add make_xls function for creating Excel files in old format and improve sheet name sanitization

* fix: handle default date formatting

* refactor: changes xlsx builder usage

* refactor: update xlsx style builder usage

* refactor: enhance field info retrieval with default field support

* fix: handle update key in report data

* refactor: enhance get_field_info to include options and improve label retrieval

* fix: improve error handling for unsupported file formats and ensure applied filters are set correctly

* refactor: update XLSX header index handling and improve metadata structure

* fix: handle currency formatting in reportview export

* fix: update default date format to datetime format in XLSX creation

* fix: update serial number field in auto email report to use 'sr' instead of 'idx'

* fix: enhance XLSX styling by adding right alignment for specific field types

* chore: remove unused code

* fix: update XLSXMetadata attributes for improved report styling options

* perf: further improve currency styling

* fix: correct column index mapping in XLSX export header

* refactor: optimize indentation style registration in XLSXStyleBuilder

* perf: improve apply_indentations

* fix: reduce more attr lookup

* refactor: remove duplication

* fix: use report name in XLSX export instead of hardcoded title

* fix: remove ignore_visible_idx from XLSXMetadata

* fix: review

* fix: update XLSX style fetching logic in build_xlsx_data function

* fix: add right alignment to date, time, and datetime styles in XLSXStyleBuilder

* fix: simplify number format handling in XLSXStyleBuilder

* fix: register common styles in XLSXStyleBuilder for improved style management

* test: add tests for XLSX styles structure and fieldtype column styles in XLSXStyleBuilder

---------

Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
2026-04-21 19:07:43 +05:30
Abdeali Chharchhodawala
3796860c92
fix: simplify total row calculation logic in query report (#38677) 2026-04-20 10:38:34 +00:00
Kaushal Shriwas
60a7d1f7e9 fix: consistency of datetime field for query report while exporting 2026-03-18 14:05:30 +05:30
Aarol D'Souza
68727cbd61
fix: add type hints to whitelisted methods 4 (#37204)
* fix(utils): add type hints to whitelisted methods

* fix(desktop): add type hints to whitelisted methods

* fix(listview): add type hints to whitelisted methods

* fix(access_log): add type hints to whitelisted methods

* fix(setup_wizard): add type hints to whitelisted methods

* fix(notification_settings): add type hints to whitelisted methods

* fix(calendar): add type hints to whitelisted methods

* fix(notifications): add type hints to whitelisted methods

* fix(query_report): add type hints to whitelisted methods

* fix(load): add type hints to whitelisted methods

* fix(save): add type hints to whitelisted methods

* fix(user): add type hints to whitelisted methods

* fix: correct Document import

* fix(list_view_settings): add type hints to whitelisted methods

* fix(reportview): add type hints to whitelisted methods

* fix(treeview): add type hints to whitelisted methods

* fix(linked_with): add type hints to whitelisted methods

* fix(bulk_update): add type hints to whitelisted methods

* fix(assign_to): add type hints to whitelisted methods

* fix(workspace): add type hints to whitelisted methods

* fix(kanban_board): add type hints to whitelisted methods

* fix(event): add type hints to whitelisted methods

* fix(email): add type hints to whitelisted methods

* fix(exporter): add type hints to whitelisted methods

* fix(permission_manager): add type hints to whitelisted methods

* fix(dashboard_chart): add type hints to whitelisted methods

* fix(number_card): add type hints to whitelisted methods

* fix(tag): add type hints to whitelisted methods

* fix: add hook to force type hints on all whitelisted endpoints

* fix: target_doc can be dict/json string

* fix: doc can be dict/json string

* fix(tests): add type hints to whitelisted methods in test

* fix: tree method is optional

* test: Fix test api types

* chore: drop dead code

* fix: document can be int

* fix: Number card input can be document

As utils in some other API calls

* fix: Always use session user

The only usage of this API that makes sense.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2026-02-20 14:53:08 +05:30
Akhil Narang
5d86be2e76
Merge pull request #36754 from Abdeali099/add-total-row-if-filterd
fix: handle total row in export of data
2026-02-17 15:11:31 +05:30
Deepesh Garg
eb4b5f7973
perf: Custom query report optimization (#37078) 2026-02-17 11:14:04 +05:30
Abdeali Chharchhoda
228df3bfa5 fix: skip total row calculation for prepared reports when specified 2026-02-07 01:53:23 +05:30
Abdeali Chharchhoda
09e4f70240 chore: improve error logging title for report execution failures 2026-02-06 23:17:08 +05:30
Abdeali Chharchhoda
e12d58209d refactor: add type hints to parameters in run function 2026-02-06 23:15:13 +05:30
Abdeali Chharchhoda
861c450ca6 fix!: do not add total row index in visible index 2026-02-06 19:15:44 +05:30
Abdeali Chharchhoda
9fa55476b7 fix: handle total row in export of report with column filters 2026-02-06 19:05:48 +05:30
Sagar Vora
6dfabf9912 perf: reduce frappe.as_unicode calls and use str.replace 2026-01-26 13:46:20 +05:30
Abdeali Chharchhodawala
dec3f07d01
fix: prevent empty filter export in query report (#35357) 2025-12-23 11:12:10 +05:30
Abdeali Chharchhodawala
4647986aeb
fix!: Always Bold report header row (#34703)
* fix: Always bold report header row

* fix: update test cases

* refactor: add option to bold filter rows in XLSX output

* chore: minor changes

* chore: rename index variable

* revert: undo bold filters param use

* refactor: remove duplication for building xlsx data

* revert: add has_filters parameter to check for filter row bold

* refactor: add type hints and docstrings for XLSX data handling functions
2025-12-11 15:55:51 +05:30
Abdeali Chharchhodawala
af3e272037
fix: improve handling of hidden columns in XLSX export (#34944) 2025-12-01 14:40:53 +05:30
mergify[bot]
af27ab36e4
Merge branch 'develop' into 32489-role-perm-based-masking 2025-09-19 09:32:01 +00:00
Raffael Meyer
4ef2a72278
feat: translate filename of exported report (#34046) 2025-09-18 14:40:38 +02:00
Ejaaz Khan
e66b6acc90
Merge pull request #34015 from iamejaaz/47622-report-link-field-permission
fix(QueryReport): respect user permissions in Link fields
2025-09-18 15:56:13 +05:30
Akhil Narang
38fbe65d09
fix: call format() on the result of _() (#34016)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-09-17 19:54:17 +00:00
Ejaaz Khan
d80e41cca3 feat: mask queery report data 2025-09-17 17:15:41 +05:30
Ejaaz Khan
7c60ce811a fix: check for none/empty js filters 2025-09-17 14:50:38 +05:30
Ejaaz Khan
94d31b5cdc refactor: remove debigging statements 2025-09-17 12:49:40 +05:30
Ejaaz Khan
67fc4a7ad4 fix(QueryReport): respect user permissions in Link fields 2025-09-17 12:47:39 +05:30
Akhil Narang
bc6f08fc28
fix: use .format() instead of f string
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-09-16 12:01:15 +05:30
Rahul Agrawal
c52e5157b4
feat: allow users to export report in background (#33861)
* feat: allow users to email prepared report

* fix: add export in background checkbox in export dialog

* chore: use a common function to send report email

* feat: delete generated files from system after user defined duration

* feat: add exported reports in a folder and periodically clean it

* test: add test for export via report

* fix: add exported folder path as constant

* chore: un-edit report.json

* refactor: for readability

* chore: type hint

* refactor: let the BG job fail if email fails

* refactor: consistent `report_name`

* it reads better now, e.g. attached_to_name=report_name instead of attached_to_name=title

* refactor: `return_file` to its inverse `populate_response`

* chore: more specific error message

---------

Co-authored-by: Rahul Agrawal <deathstarconsole@Rahuls-MacBook-Air.local>
Co-authored-by: Hussain Nagaria <hussainbhaitech@gmail.com>
2025-09-05 14:34:55 +00:00
Niraj Gautam
aca2801897
Parse html to text in export_query (#32794)
* fix: Parse html to text in export_query

* chore: Use xlsx data for csv content
2025-07-23 18:19:52 +05:30
Diptanil Saha
ba298488c5
feat: include hidden columns in query report export file (#33333) 2025-07-16 11:22:07 +05:30
Ejaaz Khan
c72a9351d4 refactor: change site to request cache 2025-06-18 11:04:56 +05:30
Ejaaz Khan
8734d45033 refactor: remove duplicate code 2025-06-17 20:44:20 +05:30
Ejaaz Khan
e6eb4a73d7 refactor: revert permssion changes 2025-06-17 15:40:59 +05:30
Ejaaz Khan
771d6fe9e1 refactor: instead of local use site cache 2025-06-17 15:39:30 +05:30
Ejaaz Khan
484a43736a fix: query report read and if_owner permissions 2025-06-16 02:13:48 +05:30
Ejaaz Khan
a73ddf41f2
Revert "fix: query report read permission issue" 2025-06-10 11:35:25 +05:30
Ejaaz Khan
cd6644d568
Revert "fix: exclude if owner from accessing all report" 2025-06-03 17:03:54 +05:30
Ejaaz Khan
9112ec2d97 fix: exclude if owner from accessing all report 2025-05-27 14:35:21 +05:30
Ejaaz Khan
f72bd90fef fix: query report read permission issue 2025-05-15 18:03:36 +05:30
sokumon
c547bdcb78 fix: remove print statement 2025-04-11 18:13:32 +05:30
sokumon
6b85e94e5b fix: respect include filters while generating report name 2025-04-11 14:14:29 +05:30
Soham Kulkarni
9a1509bcf0
Merge pull request #31920 from sokumon/filters-in-report-name
fix: hard checks on report name length
2025-04-01 13:35:04 +05:30
sokumon
a2ead69051 fix: restructure logic to generate report name 2025-03-28 01:16:02 +05:30
Ejaaz Khan
21c814f46a fix: redirect to report from workspace 2025-03-27 20:27:39 +05:30
sokumon
584f63c9b0 fix: hard checks on report name length 2025-03-26 18:40:32 +05:30
sokumon
74fd714277 fix: change if to elif 2025-03-10 16:49:20 +05:30
sokumon
77e318d9d6 fix: small change 2025-03-10 15:26:38 +05:30
sokumon
2b8a6352ea fix: add all formating fields inside one function 2025-03-10 14:54:54 +05:30
sokumon
1d096040d8 fix: change condition 2025-03-10 13:20:33 +05:30
sokumon
d511499c1a fix: add currency precision formatting while exporting report 2025-03-10 13:02:56 +05:30