Commit graph

4017 commits

Author SHA1 Message Date
Saqib Ansari
a8c373a2f4
Merge pull request #38576 from nextchamp-saqib/concurrent_limit
feat: add `@frappe.concurrent_limit()` decorator
2026-04-23 22:55:59 +05:30
Saqib Ansari
53e7e34948 refactor: make token initialization simple 2026-04-22 16:20:54 +05:30
Saqib Ansari
850cc58664 fix: clear_cache for shared cache 2026-04-22 16:20:54 +05:30
Saqib Ansari
0064eb80b4 fix: support shared RedisSemaphores for concurrency limits 2026-04-22 16:20:54 +05:30
Saqib Ansari
7f78cd25f9 refactor: extract RedisSemaphore into redis_semaphore.py 2026-04-22 16:20:54 +05:30
Aarol D'Souza
b828efe1b5
Merge pull request #38791 from iamejaaz/pdfkit-parsing-meta
fix: disable meta tag parsing in pdfkit
2026-04-22 13:45:06 +05:30
Ejaaz Khan
69018ad4b5 fix: disable meta tag parsing in pdfkit
Co-authored-by: Ankush <ankush@users.noreply.github.com>
2026-04-22 12:11:00 +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
Aarol D'Souza
4358f5bd44
Merge pull request #38740 from AarDG10/fix-backup
fix(response): harden download_backup
2026-04-21 12:11:08 +05:30
AarDG10
0c660477ee fix(response): harden download_backup
Made use of util `check_path_safety` to ensure sandboxing.
2026-04-20 18:58:21 +05:30
Soham Kulkarni
57a94ca566
Merge pull request #38726 from sokumon/default-workspace 2026-04-20 14:28:25 +05:30
sokumon
767099268a fix: consider default workspace after login 2026-04-20 01:29:22 +05:30
Saqib Ansari
e8c7eb946b refactor: rewrite concurrent_limit to use LIST + BLPOP semaphore
Replace the INCRBY-based polling loop with a proper token pool backed by
a Redis LIST. BLPOP blocks until a token is available instead of sleeping
and retrying, which is more efficient and avoids the check-then-act race
of the old counter approach.

Other fixes bundled in:
- Add `blpop` and `setnx` wrappers to `RedisWrapper` so all key prefixing
  goes through `make_key` consistently
- Cache `_default_limit()` result with `@redis_cache(shared=True)` to
  avoid importing `multiprocessing` on every request
- Fix `limit=0` edge case: use `is not None` guard instead of falsy check
- Guard `_release()` against pushing the `"fallback"` token back into the
  pool when Redis was unavailable during acquire
2026-04-18 14:21:33 +05:30
Aarol D'Souza
11066591ed
Merge pull request #38643 from AarDG10/fix-page
fix(page): improve secure local resource access
2026-04-18 12:14:04 +05:30
Ejaaz Khan
8f4c8baabb
Merge pull request #38636 from KerollesFathy/translate-fraction-currency
fix: add translation context for fraction currency
2026-04-17 10:00:54 +05:30
Nikhil Kothari
d8ad02d643
fix: add "%d-%b-%y" to guess date format (#38655) 2026-04-16 16:42:09 +00:00
AarDG10
0c3cef5237 fix(page): improve secure local resource access 2026-04-16 13:57:49 +05:30
KerollesFathy
6fe3468dd0 fix: add translation context for fraction currency 2026-04-15 21:54:21 +00:00
Shrihari Mahabal
16440d71e9
Merge pull request #37861 from ShrihariMahabal/get-docs
feat: get_docs to fetch instantiated document objects from db
2026-04-15 11:24:21 +05:30
Aarol D'Souza
4e52cbfb95
Merge pull request #38566 from AarDG10/fix-user
fix(user): sanitize all html tags in name fields in User Doctype
2026-04-14 17:07:48 +05:30
AarDG10
c3d8214124 feat(html_utils): introduce wildcard in sanitize_html
Introduces a wildcard i.e. Disallows all HTML tags when used.
2026-04-13 20:53:04 +05:30
Ejaaz Khan
c6b0587f3b
Merge pull request #38550 from AarDG10/fix-pdf
fix(print_utils): fix pdf rendering via chrome by considering bytes
2026-04-13 12:23:32 +05:30
Rucha Mahabal
cc74712304
feat: after_build hook (#38518)
* feat: `after_build` hook

* feat: add option to skip running `after_build` hooks

* feat(boilerplate): add `after_build` hook

* revert: "feat: add option to skip running `after_build` hooks"

This reverts commit 6e9d2c6a2333d487fcf4d1908c366b496a8d80b1.
Removing the flag for now as other hooks (like after/before migrate) don't have a skip option either
2026-04-13 12:15:38 +05:30
AarDG10
255a3e94fa fix(print_utils): fix pdf rendering via chrome by considering bytes
Issue has been caught w/ chrome pdf generator, it returns bytes. This fixes that by considering bytes and then turning it into a PdfWriter obj.
2026-04-13 11:53:39 +05:30
Ankush Menat
0d8ddb5958 Merge branch 'develop' into get-docs 2026-04-08 10:50:31 +05:30
Raffael Meyer
dadf822152
fix(Translation): don't remove HTML from source_text (#33558) 2026-04-07 21:09:56 +02:00
Ejaaz Khan
f423bf4979
Merge pull request #38399 from iamejaaz/ui-pdf-debugging
feat(PrintFormat): UI pdf debugging
2026-04-04 17:29:30 +05:30
Ejaaz Khan
fcb40f71c4 fix: restricts PDF debug mode to developer mode only 2026-04-04 09:45:18 +05:30
Ejaaz Khan
849785b668 feat: add UI debugging option 2026-04-04 09:15:46 +05:30
Raffael Meyer
bedb08485e
fix: use secrets for random string generation (#38338) 2026-03-30 19:08:16 +02:00
Faris Ansari
f565ed2438
fix: apply exif orientation before stripping the tag (#37998) 2026-03-25 19:51:40 +05:30
Jayanta
9ff6043693
fix(boilerplate): add apt dependencies section for Frappe Cloud (#38198)
* fix(boilerplate): Add apt dependencies for Frappe Cloud

Add apt dependencies section for Frappe Cloud deployment
2026-03-24 16:51:28 +05:30
mergify[bot]
1907293ba7
Merge branch 'develop' into get-docs 2026-03-19 11:48:31 +00:00
Jannat Patel
97510d125c fix: redirect website user to default home after social login 2026-03-18 12:39:01 +05:30
AarDG10
3e14434f9e fix: add fallback to also check for translation w/ html tags
Adds a fallback to check for translations w/ and w/o HTML tags.
2026-03-13 11:56:48 +05:30
Akhil Narang
c5bf0d3f59
fix: prevent user from setting same password on forced reset (#37652)
Co-authored-by: UmakanthKaspa <kaspaumakanth1999@gmail.com>
2026-03-11 18:06:15 +05:30
Shrihari Mahabal
c174881534 refactor: change existing functionality in framework to check if get_docs is working 2026-03-10 13:26:38 +05:30
Ankush Menat
546100ec60
fix: check return type of getattr (#37873) 2026-03-09 14:04:25 +00:00
Nikhil Kothari
733e62ba2c
feat: add support for DD-MMM-YYYY in data import (#37853) 2026-03-08 19:17:48 +00:00
Akhil Narang
3e4f139ff3
fix: use string representation of exceptions in translated strings (#37756)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-03-06 13:02:16 +05:30
Ejaaz Khan
a5d591230b
Merge pull request #37745 from kaulith/fix/print-format-builder-beta-header
fix: pass letterhead and render layout header/footer in print format
2026-03-04 22:28:58 +05:30
Akhil Narang
cacb6b65f8
Merge pull request #37747 from akhilnarang/oauth-first-name-fallback
fix(oauth): add another fallback for first name
2026-03-04 11:48:34 +05:30
Akhil Narang
1707a7cb96
fix(oauth): add another fallback for first name
Github doesn't mandate a first name, but frappe does, so fallback to username.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-03-04 11:38:40 +05:30
Kaushal Shriwas
84fb0d000c fix: pass letterhead and render layout header/footer in print format builder beta browser print 2026-03-04 02:02:01 +05:30
Ejaaz Khan
742e8407b5
Revert "feat: use chrome from system/docker file" 2026-03-03 12:03:20 +05:30
Ejaaz Khan
f86fe795b6
Merge pull request #37713 from iamejaaz/37464-default-pdf-issue 2026-03-02 20:39:06 +05:30
Ejaaz Khan
8028890137 feat: use chrome from system/docker file 2026-03-02 20:26:23 +05:30
Ejaaz Khan
c7ac52a71e
Revert "fix(pdf): removal of header and footer margins" 2026-03-02 19:29:36 +05:30
Kerolles Fathy
cfc2007f65
fix: allow dangerous HTML in link exists exception (#37677)
* fix: allow dangerous HTML in link exists exception

* fix: Allow `a` tags

* Revert "fix: allow dangerous HTML in link exists exception"

This reverts commit 9a37f5092ed6c27ff6a0c427df6494561e971ac3.

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2026-03-02 09:00:43 +00:00
Suraj Shetty
d518bc7307
Merge pull request #37189 from krantheman/fix-report-pdf-layout 2026-02-26 16:21:23 +05:30