Commit graph

84 commits

Author SHA1 Message Date
Rushabh Mehta
ddee23f5ad fix(ui): sortable sidebar, fixes to breadcrumbs etc 2024-09-06 14:12:36 +05:30
Ankush Menat
a16db1be32
fix: show relative path in loaded JS (#23964)
[skip ci]
2023-12-27 10:46:30 +05:30
Raffael Meyer
f0155674a5
refactor!: remove redundant sending of translations (#22962)
* chore!: remove redundant translation

* refactor!: remove "get_translated_dict" hook

Instead, include the results from
`frappe.geo.country_info.get_translated_dict` in `get_all_translations`.

* test: money_in_words uses translated currency

... and now we have translations.

* Revert "test: money_in_words uses translated currency"

This reverts commit e07d594ac1ce4b120c0fceb5d23377cb981fe820.

* refactor!: stop translating timezone and currency

* refactor: rename `get_translated_dict`

... to `get_translated_countries`
2023-11-02 20:04:14 +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
Ankush Menat
8a37d6d278
perf: reduce memory usage of background processes (#21467)
* perf: defer translation.py imports

This indirectly imports babel which isn't really required most of the
time.

* perf: defer gzip import

* perf: move validate_and_sanitize_search_inputs

This causes all sorts of indirect imports and increases memory usage

* perf: defer requests module imports

* perf: defer system settings import

* perf: defer LOG_DOCTYPES import

Causes many indirect imports

* perf: defer update_site_config

* perf: defer notifications import

* perf: remove unused import

* perf: defer safe exec import

* test: memory usage overhead
2023-06-23 12:51:45 +05:30
gavin
09501da12f
fix(meta): Revert to using conf over _dev_server for cache (#21391) 2023-06-15 17:45:10 +05:30
Ankush Menat
8a30667a97
fix: Fetch non-cached version of Meta on Customize Form. (#21269)
* fix: Replace meta cache when uncached meta is requested

* fix: use meta from DB on customize form

* refactor: make cached kw only, use _dev_server
2023-06-12 14:59:42 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Deepesh Garg
d0cc2043c9
fix: String formatting index in error message (#19977) 2023-02-10 22:26:44 +05:30
Sagar Vora
0fd3c5a0f0
perf(DX): use cached Meta to create FormMeta (#19736) 2023-01-25 11:56:11 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Ankush Menat
be7fd7a58d fix: point to custom field link instead 2023-01-24 12:41:05 +05:30
Ankush Menat
30e9fc4cb6 chore: remove unnessary todo comment 2023-01-23 20:05:28 +05:30
Ankush Menat
391edba10a fix(UX): better error message for dead link fields
Link fields referring to non-existing doctypes are possible when

- Removing customizations.
- Removing app which added a custom field but didn't clean up after
  itself.

[skip ci]
2023-01-23 16:43:57 +05:30
Ankush Menat
39faf34ba4
fix: ignore empty/None scripts (#19111) 2022-12-05 13:32:45 +05:30
Ankush Menat
2b6fc68088
Revert "fix: drop Meta cache during update" (#18186)
* Revert "fix: drop Meta cache during update (#18182)"

This reverts commit 656f6df257.

* fix: replace meta cache keys

Old keys stored different types of data `dict` changing key to indicate
change in type.
2022-09-19 21:28:45 +05:30
Sagar Vora
fc3ee12baf
perf: cache FormMeta directly (#18165)
* perf: cache `FormMeta` directly

* perf: check if `dt` is table, use `db.get_value` instead of `get_all`
2022-09-19 16:10:32 +05:30
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
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
Sagar Vora
a33c2e2abe
refactor(BaseDocument)!: improved get, set and extend methods (#16540)
* perf!: 80% faster doc.get for fields with `None` as value

* perf: quicker init child (#3)

* refactor: avoid repitition and improve error message

* test: `doc.extend`

* fix: improve constant naming

* fix: minor improvements and tests

* refactor: improve naming
2022-05-04 18:37:06 +05:30
Faris Ansari
5fb2bfab4b feat: allow multiple client scripts 2022-04-12 13:22:32 +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
Sagar Vora
75b6ee398c fix: AttributeError when initialising FormMeta 2022-02-22 12:44:30 +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
Gavin D'souza
793b5638d3 style: Fix E201, E202, E401, E701
reported by sider: https://sider.review/gh/repos/1864194/pulls/13344?statuses#issues
2021-05-27 12:48:01 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Ankush Menat
8dd925743c
feat(DX): sourceURL for injected javascript
Adds sourceURL to injected javascript code, this helps in debugging
injected javascript using client script or doctype specific javascript.

`no-docs`
2021-04-26 22:22:25 +05:30
Faris Ansari
887c92c5d9 fix: rename field to simply "view" 2021-03-16 17:48:12 +05:30
Faris Ansari
cf160fa125 fix: remove print statement 2021-03-16 17:42:40 +05:30
Faris Ansari
41a811af8c feat: Client Script for List views 2021-03-16 17:33:05 +05:30
Gavin D'souza
79cb3f0596 feat: Rename "Custom Script" to "Client Script"
* Remove postfix "-Client" from ClientScript.autoname
2021-02-04 14:06:09 +05:30
Rushabh Mehta
30a041646c feat(guest-access): Allow Guest to view, edit allowed forms, making way remove web forms 2020-12-10 15:13:51 +05:30
Mangesh-Khairnar
1c56732de5 feat: add option to disable custom script 2020-08-24 22:07:41 +05:30
Rushabh Mehta
9f26548b31 fix(minor): update web page test and allow dashboards for custom doctype 2020-04-19 18:01:06 +05:30
Rohan
355fc4b49e feat: allow extending doctype dashboards via hooks (develop) (#8336)
* feat: allow overriding dasboards via hooks

* fix: allow extending dashboard data in hooks

* fix: move logic to generic function

* format: added description to hook
2019-09-08 02:29:43 +05:30
Rushabh Mehta
98b1608ce9
Merge pull request #7100 from netchampfaris/doctype-form-ux
fix: Doctype UX
2019-03-22 17:59:07 +05:30
Faris Ansari
f724cd84a1 fix: Remove usage of script_type 2019-03-22 00:32:50 +05:30
Faris Ansari
60a9b6cb06 wip: fields not mandatory 2019-03-22 00:31:28 +05:30
Sagar Vora
280854fd6b feat: allow regional js in list view (#7066)
Required for https://github.com/frappe/erpnext/pull/16907
2019-03-13 13:58:34 +05:30
Faris Ansari
e2582c6306 fix(meta): Load assets only once in meta (#6004) 2018-08-23 15:40:19 +05:30
Rushabh Mehta
b1857a5132
optimize(meta): meta is now cached in redis (#5948)
* optimize(meta): meta is now cached in redis

* fix(meta): test fixes

* fix(meta): codacy

* fix(meta): allow nulls to be serialized

* fix(form_meta): fix form meta caches

* fix(form_meta): fix form meta caches

* fix(form_meta): don't cache for developer_mode'
2018-08-09 11:24:42 +05:30
Faris Ansari
a406e5db68 Kanban board fixes (#5933)
* class.extend -> es6 class

* fix(kanban): Fix kanban creation from sidebar

Creating custom fields from client side breaks in cases when DDL
queries and normal queries were run simultaneously.
Now, we do the heavy lifting on the server side

Also, moved kanban specific code from list_sidebar to kanban_view

* style: replace function with arrow functions

* style: semicolon
2018-08-07 14:41:51 +05:30
Rushabh Mehta
a5d6ee666b [fix] for custom docs 2018-06-27 14:09:04 +05:30
Rushabh Mehta
f187deb331 dont add code for custom doctypes 2018-06-26 19:17:45 +05:30
Rushabh Mehta
c4e1b9e0c1
[enhance] Add condition in transitions and move workflow to server-side (#5399)
* [workflow] move to server side

* [workflow] tests

* [workflow] tests

* [minor] remove print

* [fixes] tests and lint

* [tests] fix typo

* [fix] tests
2018-04-11 00:38:13 -08:00
Achilles Rasquinha
b5964b58a4 Fixed Python 3 2018-03-20 00:45:07 +05:30
Achilles Rasquinha
4433250cda Python 3 fixes 2018-02-13 12:27:02 +05:30
Aditya Hase
e6bd1e4995 Replaced all instances of 'unicode' with 'six.text_type' (#3825) 2017-08-02 16:57:39 +05:30
Manas Solanki
d0857f8013 Apply User Permissions is being ignored for blank field values (#3496)
* issue where Apply User Permissions is being ignored for blank field values

* configurable settings and added test case

* Update system_settings.json

* save and use locally stored value for strict user permission
2017-07-06 10:48:12 +05:30
Revant Nandgaonkar
36a54e29e8 Add js to doctype calendar view (#3599) 2017-07-05 11:08:09 +05:30