Commit graph

97 commits

Author SHA1 Message Date
Akhil Narang
182dc7213d
fix(printview): ensure document title is a string
Nothing is stopping people from setting non-string types as their title

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-09-12 13:34:59 +05:30
Maharshi Patel
ce2d91c751
feat: hook for print format template loader (#25037)
* feat: hook for print format template loader

currently logic for how print format template should be loaded is hardcoded
added hook to allow for custom logic to be implemented by other apps.

if hook returns falsy value, then default logic will be used.

* chore: use Walrus Operator and handle Empty Hooks
2024-02-26 20:20:25 +05:30
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +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
barredterra
ad93afcd4c fix: use system font for printing
This way, content from Text Editor will have the same style as the rest of the print.
2023-12-25 18:28:18 +01:00
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
Ankush Menat
0fd6f5eed7
Merge pull request #23827 from frappe/api-docs
docs: add Python API missing docstrings / type hints
2023-12-21 12:13:05 +05:30
Hussain Nagaria
bb68d879c2 fix: type hint issue 2023-12-19 14:01:41 +05:30
Hussain Nagaria
2f277c66ae fix: use optional 2023-12-19 13:57:35 +05:30
Hussain Nagaria
3520bcb9b3 fix: add (more) type hints printview.py 2023-12-19 12:55:02 +05:30
Sagar Vora
3820926ffa fix: dont pass removed parameter name 2023-12-19 12:08:28 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Maharshi Patel
1bae6a2b0b
feat: hooks added for print formats / pdf. (#20734) 2023-04-17 19:03:53 +05:30
Sagar Vora
a56ea73b7d fix: escape HTML instead of sanitizing 2023-03-30 06:27:07 +00:00
Suraj Shetty
09ea38e96f fix: Set link title in PDF
Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
2023-03-15 14:14:41 +05:30
Raffael Meyer
ed30a6d59f
refactor(minor): use DocStatus (#19545) 2023-01-10 17:38:11 +05:30
Gavin D'souza
06cf18d0aa chore: Add optional typing hints for params with default None 2022-12-15 13:47:05 +05:30
Gavin D'souza
cff0567faf fix(print): Check doc permission before checking related info 2022-12-15 13:47:05 +05:30
Gavin D'souza
d3250f6504 refactor(whitelisted): Add typing hints to APIs
* Refactor type checks defined in APIs
* Remove dead/deprecated kwargs usages
* Added appropriate hints to APIs and consecutive utils defined in the following modules:
 - frappe.realtime
 - frappe.translate
 - frappe.utils.global_search
 - frappe.www.third_party_apps
 - frappe.www.search
 - frappe.www.printview
2022-12-15 13:47:05 +05:30
Sagar Vora
8cc504709b fix: only accept string values for key 2022-11-23 23:00:48 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Suraj Shetty
a4f2912fdf fix: Handle case where document title can be NONE
(cherry picked from commit 9b67fc24bc290789158f37a8f2ce10b505878792)
2022-06-13 06:16:56 +00:00
Suraj Shetty
121fb49fb5 refactor: Remove unnecessary code 2022-06-01 18:10:30 +05:30
Suraj Shetty
8f7d8bf1ff refactor: Update exception names 2022-06-01 17:59:19 +05:30
Suraj Shetty
f7db085db5 perf: Simplify code to avoid unnecessary DB calls 2022-06-01 17:56:46 +05:30
Suraj Shetty
af287a04a9 refactor: Remove unnecessary exception handling 2022-06-01 17:50:07 +05:30
Suraj Shetty
0d10624ce5 Merge branch 'develop' of https://github.com/frappe/frappe into fix-document-signature 2022-05-05 14:20:29 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Suraj Shetty
af67849928 feat: Option to Print or download PDF in print view 2022-02-18 14:26:33 +05:30
Suraj Shetty
0388398133 Merge branch 'develop' of https://github.com/frappe/frappe into fix-document-signature 2022-02-17 10:49:55 +05:30
mergify[bot]
4d18546a9b
Merge pull request #15953 from resilient-tech/optimize-print
fix: pass `print_heading_template` directly in render args
2022-02-16 03:47:53 +00:00
Pruthvi Patel
97bab50a58 fix: pass print_heading_template as render args 2022-02-11 18:51:10 +05:30
Suraj Shetty
7b69497841 fix: Add setting "allow_older_web_view_links" in System Settings 2022-02-07 16:25:17 +05:30
Suraj Shetty
e0e12d43f1 Merge branch 'develop' of https://github.com/frappe/frappe into fix-document-signature 2022-02-07 13:26:57 +05:30
Suraj Shetty
b7f156f580 fix: Rename "Document Key" to "Document Share Key" 2022-02-07 13:25:39 +05:30
Saqib Ansari
b42cc400b9 Merge branch 'develop' of https://github.com/frappe/frappe into link_title_refactor 2022-02-01 15:08:57 +05:30
Suraj Shetty
4aab56edfc refactor: Permission validation for print view
- Show UI based on the status of the key/permission
- Respond with proper http_code according to the permission validation
2022-01-19 12:38:37 +05:30
Suraj Shetty
afeddbb96d fix: Document key expiry logic 2022-01-18 19:27:33 +05:30
Suraj Shetty
abaa2dc35e
style: Fix formatting issue 2022-01-18 11:57:38 +05:30
Suraj Shetty
f0ebd13c84 fix: Logic to show link expired message 2022-01-13 12:16:36 +05:30
Suraj Shetty
4ee99ce7e1 feat: Set expiry to document link 2022-01-13 11:45:45 +05:30
Suraj Shetty
499625a85f fix: Allow old signature as well 2021-12-27 23:45:21 +05:30
Don-Leopardo
c9ce941554 fix: Unused imports 2021-12-22 14:38:13 -03:00
Don-Leopardo
0b1821b10a fix: Module path for external print formats 2021-12-22 14:38:03 -03:00
Suraj Shetty
3c1db7881a fix: Maintain document signature in Document Key table 2021-12-21 15:43:10 +05:30
Saqib Ansari
ab9700d947 Merge branch 'develop' of https://github.com/frappe/frappe into link_title_refactor 2021-12-15 19:32:16 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30