Commit graph

146 commits

Author SHA1 Message Date
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
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
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
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
0xsaif
aa7ee1c6b9
refactor: force ipv4 localhost (#22394)
* reafctor: force ipv4 localhost

Replacing "localhost" with "127.0.0.1" in the codebase; sometimes the name localhost force-resolves to ipv6

* revert: leave localhost usage in oauth tests

Change not required.

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-13 16:23:23 +05:30
Ankush Menat
dc8d7b019a refactor!: Lower roles from All To Desk User 2023-08-29 12:07:57 +05:30
barredterra
88c8baa9ee refactor: for append to extend, merge list extend
Replace a for append loop with list extend.
Create the list with values instead of creating
an empty list and extending it with another list.
2023-08-09 13:25:39 +02:00
David Arnold
fddd3b24f7
test: skip tests on RO app paths which require write access (#21878) 2023-07-31 12:46:23 +05:30
Ankush Menat
927cd647e4 chore: generate type annotations 2023-07-24 15:32:48 +05:30
Suraj Shetty
eda8be74ca fix: Hide font-size from print format
- Since it is only used in new print format builder
and it can be set via new print format builder's interface
2023-05-31 15:44:05 +05:30
Suraj Shetty
55455cef4e fix: Update label
"in PDF" is not required as it is already under PDF settings.
2023-05-31 09:03:07 +05:30
Ankush Menat
8446875257
refactor!: Remove "Set user permission" permtype (#20090)
This has never worked and setting user permission requires system
manager role always (because of permissions on list view)
2023-02-20 16:07:49 +05:30
Ankush Menat
c69c040186 chore: typo 2023-02-13 18:26:09 +05:30
Ankush Menat
b8ba7dcdb3
fix: Setting default print format (#19862)
- Remove check for developer mode, it's not even valid as we dont allow
  setting default print format like this
- Set in custom doctype if custom doctype else prop setter.
- query meta instead of doctype.

[skip ci]
2023-01-31 17:52:35 +05:30
Samuel Danieli
4d08f50a03
fix: PermissionError (#19856)
* fix: PermissionError

* fix: check perm on customize form

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-01-31 16:04:40 +05:30
barredterra
9782f937fd refactor: use link for print format 2022-11-09 18:05:44 +01:00
Ankush Menat
2eec621e95 chore: db.get_all -> get_all
Reduces 1 pointless function call.
Function calls are also not "super cheap" in python.
2022-08-22 11:35:14 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Gavin D'souza
598359c684 test: Reset requirements for export_doc 2022-08-09 15:57:26 +05:30
Gavin D'souza
208e33afa6 test: Add cleanup for generated files 2022-08-08 15:09:21 +05:30
Gavin D'souza
624c308659 Merge branch 'develop' of github.com:frappe/frappe into modules-refactor 2022-08-08 12:27:11 +05:30
Ankush Menat
40f27f908a style: format JS files with prettier 2022-08-04 14:51:01 +05:30
Gavin D'souza
85e3ee9403 chore: Minified DocType JSON notation from old verbose notation 2022-08-03 12:22:03 +05:30
Shariq Ansari
3216529deb
fix: Letter head image not working (#17608) 2022-07-25 17:46:27 +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
Himanshu
6d6a67e9e3
feat: set image as footer in letter head (#17119)
* feat: set image as footer in letter head

* fix: do not hide footer section

* fix: hide footer source

* style: black

* fix: reduce code for setting image as html

* fix: Force system admin role only if active

* fix(ui): tab refresh was not implemented

* fix(minor): Onboarding: add option to view list view in create action

* fix(minor): js lint

* fix: allow All to select a User

* test: user permissions affecting User

* refactor: filter_dynamic_link_doctypes API

* Added typing, better variable naming
* Remove unnecessary re-iterations
* Optimize queries and membership processing

* perf: Check query type via is_query_type

* chore: Drop duplicate get_frontmatter definition

* perf: Login Page

Improves performance 3x - from 0.047s to 0.017s

* Use frappe.get_*_settings to query table once
* Use cached LDAP Settings' document via get_ldap_client_settings
* Use single get_all to query all Social Login providers and related
  data
* Skip provider if client_secret doesn't exist

* perf: About Us Settings

Use cached document for building /about page

* perf: App Page

Reduced time taken for get_context to execute from 0.035s to 0.02s (75%
reduction)

* perf: Patch qb only once - not on every init

* perf: Fetch and cache entire settings' dicts

* refactor!: frappe.db.get_singles_dict

* Cast single's values as their fieldtypes before returning
* Support previously dead debug parameter
* Consider single with no meta as non-existent; skip query

Decided to go ahead with the breaking change given the nature of the
existing usages of get_singles_dict :crie:

* ci: Run tests bypassing roulette with labels "Run UI Tests", "Run Server Tests"

* test: Scheduler tests cleanup

* chore: linter changes

* chore: linter changes

* chore: linter changes

* fix: set HTML as default

to keep existing formats working

* refactor: no **kwargs

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Rushabh Mehta <rmehta@gmail.com>
Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
2022-06-17 12:07:07 +05:30
Gavin D'souza
7e51f51f11 test: Added test for PrintFormat.export_doc
Other Changes
* Added return value for export_doc method
2022-04-14 09:58:35 +05:30
Gavin D'souza
97e911e069 Merge branch 'develop' of github.com:frappe/frappe into refactor-file 2022-04-13 10:49:26 +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
Gavin D'souza
c6bad81f24 fix: Use new direct import paths
The old paths worked too, but it's just better to use the new paths and
not go in circles ;)
2022-03-15 19:39:47 +05:30
Gavin D'souza
7a68d797e9 fix: Rename Property Setter on Print Format Rename
This fixes the default print format set when Custom Print Formats are
renamed
2021-12-27 15:02:52 +05:30
Rohan Bansal
c5464e2c5a fix: requested changes 2021-11-04 14:50:37 +05:30
Rohan Bansal
64c18a3187 feat: allow more print page size options 2021-10-26 17:04:41 +05:30
Faris Ansari
5345d4ce7b Merge branch 'develop' of https://github.com/frappe/frappe into print-format-builder-beta 2021-10-20 18:40:18 +05:30
Faris Ansari
76b5ee8b9e feat: Field Templates
- standard field templates for rendering custom templates for fields for e.g., taxes in invoice
- ability to create user defined reusable templates that show up in print format builder
2021-10-19 19:12:15 +05:30
Faris Ansari
c31bf0aadc fix: Page number
- simpler configuration
- remove arbitrary margin text configuration
2021-10-19 15:45:40 +05:30
Suraj Shetty
22ffe27217 fix: Permission check for default print format 2021-10-14 11:00:46 +05:30
Anupam
5387e48a59 fix: network printer settings permission issue 2021-10-07 12:11:29 +05:30
Faris Ansari
4bdacf7d81 feat: Better Letterhead editing
- Image resize and align
2021-10-03 14:42:45 +05:30