seitime-frappe/frappe/utils
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
..
pdf_generator fix(page): improve secure local resource access 2026-04-16 13:57:49 +05:30
telemetry fix: force type check in whitelisted methods 2 (#37086) 2026-02-19 14:58:16 +05:30
__init__.py fix: use secrets for random string generation (#38338) 2026-03-30 19:08:16 +02:00
background_jobs.py fix: ruff "unsafe" fixes 2025-12-22 21:06:48 +05:30
backups.py fix: force type check in whitelisted methods (#37044) 2026-02-17 15:16:30 +00:00
bench_helper.py fix: always print tracebacks (#28838) 2024-12-19 12:46:11 +00:00
boilerplate.py feat: after_build hook (#38518) 2026-04-13 12:15:38 +05:30
caching.py perf: faster retrieval from site cache 2025-03-16 12:35:37 +05:30
change_log.py fix: avoid shell in changelog git calls 2025-12-29 10:29:55 +08:00
commands.py style: re-format with ruff 2024-02-05 18:53:33 +05:30
connections.py fix(connections): try all available interfaces, not just ipv4 2026-01-08 18:10:02 +05:30
csvutils.py fix: force type check in whitelisted methods 2 (#37086) 2026-02-19 14:58:16 +05:30
dashboard.py fix: ruff fixes 2024-02-07 17:04:31 +05:30
data.py fix: consider default workspace after login 2026-04-20 01:29:22 +05:30
dateutils.py feat!: enhance Language to become more of a Locale (#27178) 2024-09-21 16:02:58 +02:00
defaults.py refactor: fixup with ruff 0.8.1 2024-12-04 13:18:04 +05:30
deprecations.py devx: add deprecation dumpster (#27887) 2024-10-08 18:56:10 +02:00
diff.py fix: force type check in whitelisted methods 2 (#37086) 2026-02-19 14:58:16 +05:30
doctor.py fix: check for running jobs before migrating (#31438) 2025-02-26 09:30:38 +00:00
error.py fix(error): don't return in a finally block (PEP-765) (#35610) 2026-01-05 06:41:16 +00:00
file_lock.py refactor: simplify code 2024-02-06 13:02:45 +05:30
file_manager.py fix: force type check in whitelisted methods 2 (#37086) 2026-02-19 14:58:16 +05:30
fixtures.py fix: sort file/dir names for fixtures (#33783) 2025-08-25 12:14:02 +00:00
formatters.py fix: do not round whole floats in format 2026-02-11 16:09:37 +05:30
frappecloud.py fix: granular status in system health report 2025-02-25 10:38:25 +05:30
global_search.py fix: Apply full perm logic on global search (#37400) 2026-02-23 17:55:27 +05:30
goal.py chore: deprecate validate_filters 2025-12-30 13:02:49 +05:30
html_utils.py feat(html_utils): introduce wildcard in sanitize_html 2026-04-13 20:53:04 +05:30
identicon.py refactor: fixup with ruff 0.8.1 2024-12-04 13:18:04 +05:30
image.py fix: apply exif orientation before stripping the tag (#37998) 2026-03-25 19:51:40 +05:30
inplacevar.py chore(inplacevar): lint 2025-10-03 00:13:55 +05:30
install.py fix(desktop_icon): use app_name instead of app_title 2026-02-17 03:25:02 +05:30
jinja.py Revert "fix: Always reset globals on cached templates (#30897)" (#30906) 2025-01-28 10:02:00 +00:00
jinja_globals.py chore: add include_icons jinja global 2024-06-11 20:03:15 +02:00
lazy_loader.py style: re-format with ruff 2024-02-05 18:53:33 +05:30
local.py fix: ruff "unsafe" fixes 2025-12-22 21:06:48 +05:30
logger.py Testing Module (#28000) 2024-10-07 09:46:49 +02:00
make_random.py refactor: use wildcard to avoid duplicating some queries 2026-01-08 18:56:05 +05:30
messages.py fix!: Restrict allowed HTML in msgprints (#37399) 2026-02-23 11:49:15 +00:00
modules.py perf: Remove unused empty table checks (#35469) 2025-12-29 07:28:41 +00:00
momentjs.py style: format all python files using black (#16453) 2022-04-12 10:59:25 +05:30
nestedset.py fix: rebuild tree should process nodes in *some* order (#37116) 2026-02-17 14:33:40 +05:30
number_format.py feat!: enhance Language to become more of a Locale (#27178) 2024-09-21 16:02:58 +02:00
oauth.py fix: redirect website user to default home after social login 2026-03-18 12:39:01 +05:30
password.py fix: prevent user from setting same password on forced reset (#37652) 2026-03-11 18:06:15 +05:30
password_strength.py fix: handle password feedback for common words and suggestions (#35156) 2025-12-19 14:44:22 +05:30
pdf.py fix: use string representation of exceptions in translated strings (#37756) 2026-03-06 13:02:16 +05:30
print_format.py chore: resolve conflicts 2026-02-20 15:25:46 +01:00
print_utils.py fix(print_utils): fix pdf rendering via chrome by considering bytes 2026-04-13 11:53:39 +05:30
redis_queue.py refactor: permutate implementation to assert no functional change in preparation (#28160) 2024-10-18 02:40:06 +02:00
redis_wrapper.py fix: Skip redis cache signal if redis is down (#32967) 2025-06-17 13:59:31 +00:00
response.py fix(response): harden download_backup 2026-04-20 18:58:21 +05:30
safe_exec.py fix: check return type of getattr (#37873) 2026-03-09 14:04:25 +00:00
scheduler.py refactor: change existing functionality in framework to check if get_docs is working 2026-03-10 13:26:38 +05:30
sentry.py feat: Enable Sentry Sampling 2024-10-28 11:27:51 +01:00
synchronization.py refactor: fixup with ruff 0.8.1 2024-12-04 13:18:04 +05:30
testutils.py style: format all python files using black (#16453) 2022-04-12 10:59:25 +05:30
translations.py fix(Translation): don't remove HTML from source_text (#33558) 2026-04-07 21:09:56 +02:00
typing_validations.py fix: Allow untyped self/cls (#37053) 2026-02-16 06:57:38 +00:00
user.py fix: Handle missing default workspace (#37359) 2026-02-23 11:43:25 +05:30
verified_command.py refactor: hmac generation 2022-11-12 13:05:57 +05:30
weasyprint.py fix: pass letterhead and render layout header/footer in print format builder beta browser print 2026-03-04 02:02:01 +05:30
xlsxutils.py feat!: faster generation and formatting utils for excel exports (#36323) 2026-04-21 19:07:43 +05:30