Mirrors test_ambiguous_linked_tables but with a DocType whose Link
fields point back to itself, covering the path where pypika's '2'
auto-alias collides on the second self-join.
* chore: remove _decorate_all_methods_and_functions_with_type_checker
No one understands this runtime magic anymore.
* build: Bump coverage.py to latest
* test: Skip github in coverage reporting
* test: Print traceback from all threads when test is stuck
* ci: Enable coverage in server side tests
* ci: Always enable coverage
It's cheap in recent python versions, our reasons for selectively
disabling aren't valid anymore.
* ci: Disable stderr capturing
* ci: Use default buffer behaviour in unittest runner
* ci(coverage): Set concurrency to multiprocessing
We do use multiprocessing, perhaps the patches aren't concurrectly
handled?
* ci(coverage): Try parallel run
* fix: Apply subprocess patch
* ci: Don't start web server with coverage
Causes deadlock for some reason. We don't actually report it either.
* ci: only submit UI coverage if ran
* test: remove aggresive stuck test checking
* ci: disable UI coverage
(for now)
* 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>
The test runner walks link-field dependencies recursively to pre-generate
test records via `get_missing_records_doctypes`. If any DocType in the
transitive link graph belonged to an app not installed on the test site,
the walk crashed with `DoesNotExistError`, aborting the entire suite
before a single test ran.
Treat such link targets as dead-end leaves instead:
- `get_modules` now returns `(None, None)` when the DocType row does not
exist, instead of falling through into `load_doctype_module` which
raises.
- `get_missing_records_doctypes` checks for `module is None`, logs a
warning naming the parent DocType that linked to it, and returns
without descending further.
This restores the ability to run downstream test suites that link
(directly or transitively) to optional/uninstalled apps without forcing
every CI environment to know the full transitive link graph.
Fixes#38747
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
* fix: prevent submission of non-submittable doctype
* fix: updated failing test cases to use submittable doctype as required
* refactor: corrected to_docstatus and from_docstatus use
* fix: inherit submittability from parent for child tables
* Revert "fix: inherit submittability from parent for child tables"
This reverts commit ee83ee59b4f0596e2d402a1547e92b131ae49579.
* feat: introduce skip_docstatus_validation flag
* test: add test cases for skip_docstatus_validation flag and docstatus transition of non-submittable doctype
* fix: validate ignore_user_permissions for alternative Link fields
* fix: handle alternative Link fields with ignore_user_permissions
* fix: move early exit earlier to avoid edge cases
* test: validate case of bulk edit
---------
Co-authored-by: Sagar Vora <sagarvora@users.noreply.github.com>