Commit graph

314 commits

Author SHA1 Message Date
mergify[bot]
ddd7c96924
Merge branch 'develop' into develop 2025-07-31 05:26:30 +00:00
Ejaaz Khan
4da190ca8b fix: minor fix and adds validation 2025-07-02 12:12:04 +05:30
Ejaaz Khan
c48b801c2e fix: remove default mandatory 2025-07-01 18:02:50 +05:30
Ejaaz Khan
924ca85e59 feat: print format for Reports 2025-07-01 17:33:59 +05:30
Sagar Vora
8d47138504 fix: update print heading doctype 2025-06-26 15:13:55 +05:30
Sagar Vora
b3e1eda4c8
feat: global frappe.in_test flag (#32960)
* feat: global `frappe.in_test` flag

* feat: helper utility to toggle `frappe.in_test`

* fix: use `toggle_test_mode` util

* fix: use `frappe.in_test`

* chore: add comment explaining global `in_test`

* chore: ignore commit replacing flag usage

* test: temporarily disable `frappe.in_test`

this worked earlier because flag was set in werkzeug.local which was separate for API test client

* test: add comment explaining change
2025-06-17 19:19:31 +05:30
maheini
e6d9966514
fix: Add proper html skeleton to preview iframe
This will prevent Quircks compatibility CSS rules from beeing applied, which leads to differences in preview/print-view
2025-06-15 01:57:56 +02:00
Raffael Meyer
294af0d318
fix: set print format as default (#32862)
- add param type hint
- check write perms on the specific Print Format
2025-06-12 09:33:34 +02:00
Ankush Menat
8088bd3891
chore: Drop empty UnitTestCases (#32867)
Next to zero adoption after introduction, just noise in codebase.

I don't see any point in arguing about purity of test cases when
existence and quality of test cases is usually the bigger problem.

Dropped using semgrep
2025-06-10 05:28:53 +00:00
Aayush Dalal
ca5b4cea0b
fix: throw permission error (#32860) 2025-06-10 08:47:49 +05:30
Ankush Menat
f9ff807e4c
refactor: Rename get_settings -> get_single_value (#32840)
Not all single doctypes are settings, so this is better. Implicit
caching is fine, same is done for `db` APIs on singles. We *should* aim
for 100% correctness of caching implementation, especially for singles.

Thanks to @netchampfaris for the suggestion.
2025-06-09 04:20:29 +00:00
Ankush Menat
caf415f13e
feat: get_settings (#32821)
* feat: get_settings

get_cached_value doesn't work well with singles because you either need
to pass `None` or repeat doctype name... both are awekward and easy to
shoot yourself in foot with.

* refactor: Use cached settings
2025-06-06 18:34:17 +05:30
Maharshi Patel
35b4bc2581 fix(minor): don't update modified date in patch 2025-02-19 14:09:39 +05:30
Maharshi Patel
463d1f2b05 fix: code changes as pdf_generator is now select field 2025-02-14 17:04:13 +05:30
Maharshi Patel
e818ef22f7 fix: make pdf_generator select field
As per review, renamed chrome_pdf_generator to pdf_generator and made it a select field.
- default option available for select is wkhtmltopdf.
- default for new print formats is wkhtmltopdf.
- print designer on install adds a new option ( chrome ) to the select field.
- added patch to update existing print format to wkhtmltopdf.
2025-02-14 16:27:10 +05:30
Maharshi Patel
f3e0ec5367 chore: added chrome_pdf_generator field
instead of making field custom in print_designer added field in Print Format DocType
2025-02-13 18:42:10 +05:30
Soni Karm
d4ff214a6f
fix: clear print format selector if default print format is absent (#31123) 2025-02-05 06:43:13 +00:00
Soni Karm
ecd90601fe
fix: use frappe.db.set_value instead of frappe.db.sql (#31124) 2025-02-05 06:29:07 +00:00
Ejaaz Khan
2fb0629197
fix: alignment Issues with Serial Numbers and Descriptions (#29093)
* fix: serial numbers not aligned with other cells

* refactor: remove top margin from editor
2025-01-13 11:50:01 +05:30
mahsem
e8698a98de
fix: add strings and fields to translation 2024-12-21 13:17:01 +01:00
Ankush Menat
60bc472ab6
revert: restore JSON files (#28717)
* Revert: bring back JSON files

* chore: re-apply changes to new files

* chore: remove old TOML files

* chore: delete empty files
2024-12-09 08:41:56 +00:00
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
David Arnold
0204db6547
chore: move to use new test record api (#28105) 2024-10-12 23:13:41 +00:00
David Arnold
443c38daa9
refactor: toml test records for readability (#28065)
* refactor: toml test records for readability

* fix: maintain backwards compatibility

* refactor: transform in-tree records

* chore: don't use deprecated functions (treewide)

* chore: revert migration of tests which depend on old test records list

* feat: add cls.globalTestRecords on IntegrationTestCase
2024-10-10 13:24:02 +02:00
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* refactor: constitute unit test case

* fix: docs and type hints

* refactor: mark presumed integration test cases explicitly

At time of writing, we now have at least two base test classes:

- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase

They load in their perspective priority queue during execution.

Probably more to come for more efficient queing and scheduling.

In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.

* feat: Move test-related functions from test_runner.py to tests/utils.py

* refactor: add bare UnitTestCase to all doctype tests

This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
2024-10-06 09:43:36 +00:00
Corentin Forler
e97eb26bd1
chore: Use cint instead of unary plus operator 2024-09-26 11:59:18 +02:00
Corentin Forler
1210ab33dc
feat(print_format): Add checkbox to hide label 2024-09-18 10:16:37 +02:00
Rushabh Mehta
0c8b9be47b fix(style): print format 2024-09-10 15:15:15 +05:30
Maharshi Patel
96745b8f46 fix: on load of beta print format set iframe height
there was a edge case where when print format beta was set to default which never ran code which sets the size for container that holds format.
fixed that by make iframe height to 100vh minus navbar and heading on load of beta print format
2024-09-02 11:51:39 +05:30
Nabin Hait
e54274f290
chore: Deleted all the form tours (#27403) 2024-08-20 10:39:40 +05:30
Maharshi Patel
6a6ded156f
chore: warn if wkhtmltopdf is invalid (#26174)
* chore: warn if wkhtmltopdf is invalid

wkhtmltopdf ( with patched qt ) is required to generate pdfs properly.
when user clicks on PDF, pdf will be generated and downloaded.
however, on print preview page warning will be shown.

* chore: refactor based on review comments

* chore: return False incase of exception

* chore: refactor and better naming

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2024-04-30 10:36:56 +00:00
Ankush Menat
535bc10340
fix: make letterhead attachments public by default (#25925)
Also does it for web page.

Note: This is just default config, users can change while uploading.
2024-04-12 05:14:18 +00:00
Maharshi Patel
9739023c59 fix: add in_install flag to print_format validate
don't validate "Standard Print Format cannot be updated" during installation
2024-04-01 11:59:02 +05:30
Ankush Menat
3896296c6f fix: update sort order in doctypes 2024-03-27 11:18:28 +05:30
barredterra
da1e8750c8 refactor: replace in_list(array, member) with array.includes(member) 2024-03-10 16:09:09 +01:00
Ankush Menat
b1a8bc9312
fix: Export None as type if select as no options (#25211)
Select options can be dynamic, in that case we should at least the
default value `None` as a value `DF.Literal` otherwise is invalid type
annotation.
2024-03-04 06:42:41 +00:00
Maharshi Patel
0e12cf4281
chore: replace PFB Beta link with Print Designer (#25032)
Replaced Print Format Builder Beta link in print-view to Print Designer.
if App is installed it opens Print Designer, if not it opens Frappe Cloud Marketplace Link.
2024-02-23 20:19:08 +05:30
Raffael Meyer
fc64e8a0fb
feat: pass doctype as context when translating label (#24903) 2024-02-18 19:42:15 +05:30
Ankush Menat
72c2207e0f refactor: useless use of dict in frappe.get_doc 2024-02-10 12:52:38 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Maharshi Patel
3fb418f28f
Merge pull request #23907 from marination/dynamic-header-footer-develop
feat: Letterhead Scripts & fix disappearing header in pdf
2024-02-01 17:43:12 +05:30
Corentin Flr
b474e17f89
fix(print-preview): Fix stale ref to iframe's document 2024-01-24 17:18:07 +01:00
marination
62fa5bc8af fix: Translate Letterhead information string 2024-01-22 16:15:38 +01:00
Ankush Menat
c7e5afee6a refactor: Use arr.includes(item) instead of in_list(arr, item) 2023-12-27 19:33:13 +05:30
marination
29e761671d feat: Letterhead scripts
- feat: Allow script injection into header/footer.html to allow manipulation of styles using page numbers/args received by wkhtmltopdf
- misc: also validate letterhead scripts
- Include scripts in printview as well as pdf
- Add helper instructions & re-arrange fields
2023-12-21 17:25:19 +01:00
barredterra
70c7315ed8 Merge branch 'develop' into jinja-syntax 2023-12-17 19:54:16 +01:00
Corentin Flr
4f809630c5
fix: Set sort_order to DESC if sort_field is modified (#23697)
Global search and replace operation, including single doctypes where it does not really matter.
2023-12-13 09:52:14 +05:30
barredterra
a83b5b324b feat(Print Format): switch from pure HTML to Jinja highlighting 2023-12-12 20:06:25 +01:00
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Ankush Menat
72ca95dec0
fix: Only allow standard print format modification in migrate (#23112)
* fix: Only allow standard print format modification in migrate

AFAIK only valid use case is fixtures and there too it should avoid
"standard".

* chore: typo

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

---------

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2023-11-06 19:28:10 +05:30