Commit graph

476 commits

Author SHA1 Message Date
Ankush Menat
b7bc5d3236
fix(round 3): switch to creation sorting (#25669) 2024-03-27 08:59:04 +00:00
Ankush Menat
dbcf7ad30c refactor: update usage of modified everywhere 2024-03-27 11:23:13 +05:30
Ankush Menat
8e3175f3e8
fix: show attachments on notifications too (#25443) 2024-03-14 13:01:10 +00:00
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
barredterra
10bd9a7efd fix: use communication date in timeline
Before, we used the database creation date, which coincidentally corresponds to the real communication date in many cases.
2024-02-13 15:36:53 +01:00
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
8a71054c0c
Merge pull request #24765 from ankush/black_to_ruff
ci: switch to ruff-format
2024-02-05 19:20:51 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
b6eef6ebc2
fix: Skip virtual doctypes in link field checks (#24759) 2024-02-05 18:04:31 +05:30
David Arnold
c57bc94ead
chore: cleanup frappe.connect invocations 2024-01-24 11:56:24 +01:00
mergify[bot]
4655c6c1e3
Merge pull request #23678 from niraj2477/gh-20969
feat(List View): Add button to remove multiple assignments
2024-01-13 07:57:17 +00:00
Akhil Narang
55088ce7bd
chore: translate subject as well
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-10 16:21:36 +05:30
Akhil Narang
e29b39f7df
refactor: use receiver's language for some notifications
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-10 16:21:36 +05:30
Ankush Menat
a16db1be32
fix: show relative path in loaded JS (#23964)
[skip ci]
2023-12-27 10:46:30 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
14987
ab915e3a81
feat: Add button to removing multiple assignments 2023-12-08 13:22:39 +05:30
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
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
Ankush Menat
6926669577 perf: Ignore amended_from link fields in link field checks
Small perf benefit at not much cost. `amended_from` are *always*
refererring to cancelled documents so there's no need to check these
fields.
2023-10-31 15:03:08 +05:30
Ankush Menat
08b92858a3
fix: ignore duplicate perm check on assign hooks (#22832)
* fix: Ignore permissions while assigning if flag set

* fix: Avoid double permission checks on assignment rule

When it's triggered via doc events either:
- Permission check is done or
- Permission checks are not applicable
2023-10-20 06:18:19 +00:00
Maharshi Patel
409a3a8105 Merge branch 'develop' into fix-attach-before-doc-save 2023-10-19 11:40:20 +05:30
Ankush Menat
440612f3b9
fix: Check perms before sharing linked docs (#22783) 2023-10-17 18:53:09 +05:30
Ankush Menat
691eae8e84
fix: check read before assigning/removing (#22779) 2023-10-17 18:51:44 +05:30
Maharshi Patel
fd1fe44850 fix: cypress and add check for __islocal
changed check for __islocal as well in savedocs

As new route ends with random hash instead of numbers,
updated cypress test to just check start of data-route instead of entire path
2023-10-17 17:19:53 +05:30
Ankush Menat
018ed845bd refactor: defer unnecessary json-dumping of messages
Also avoid accessing locals where interface is present like for popping last message.
2023-10-16 18:13:50 +05:30
Maharshi Patel
d9a8b7ee78 chore: rename __temporary_name & check temp_doc_name
* renamed file_relink_temp_docname to __temporary_name
* added check for temp_doc_name in relink_files in case someone
    calls the function it directly
2023-10-13 10:20:03 +05:30
Maharshi Patel
53cdd6d1bf fix: relink attachments before saving doc
Certain people add attachment, before filling mandatory fields
which will raise Missing Fields error.

Or any other kind of errors raised by different validators due to which
file is uploaded but doc is not saved.

This will lead to orphaned/mislinked files. ex. new-purchase-receipt-1

This fix changes name of new docs to new-<doctype>-<no>-<10digithash>
after saving the document we can use this new name to find any mislinked
files created in past hour and relink them to the new doc on save.
2023-10-10 23:49:16 +05:30
Ankush Menat
d20e436e0f perf: fetch user info in one query 2023-09-18 11:16:20 +05:30
Ankush Menat
8f34d6fc3e perf: docinfo
- Dont query versions if disabled
2023-09-17 14:16:47 +05:30
xdlumertz
7ddae5d11b
fix: translation in assignments
[skip ci]
2023-08-24 17:51:36 +05:30
barredterra
7c38dac8ee Merge remote-tracking branch 'upstream/develop' into close-assignment-from-sidebar 2023-08-15 18:45:17 +02:00
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
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
Ankush Menat
201be85d88 chore: remove dead code
https://sourcegraph.com/search?q=context:global+get_badge_info+repo:%5Egithub%5C.com/frappe/.*&patternType=standard&sm=0&groupBy=repo
2023-08-05 11:20:27 +05:30
Raffael Meyer
011d21b4a3
refactor: docshare get_users (#21924) 2023-08-05 09:41:22 +05:30
barredterra
fbbb453138 feat: close assignment from sidebar 2023-08-04 11:47:32 +02:00
Ankush Menat
f989b83d33 perf: drop total_comments
Can be done client side, also not used anywhere.
2023-07-22 15:09:11 +05:30
Ankush Menat
740fe1fc91 perf: reduce 1 query in getdoc 2023-07-22 14:16:08 +05:30
Shariq Ansari
76cc712f35 fix: load 21 communications to verify load more button is required or not. 2023-07-04 12:36:53 +05:30
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
Ankush Menat
4f70200bd5 chore: track update actions per doctype
[skip ci]
2023-06-22 12:10:43 +05:30
gavin
09501da12f
fix(meta): Revert to using conf over _dev_server for cache (#21391) 2023-06-15 17:45:10 +05:30
Shariq Ansari
9e0ed9d2a2 fix: convert string to int 2023-06-13 16:23:39 +05:30
Shariq Ansari
0e962078fe revert: temp fix to load communications 2023-06-13 16:20:07 +05:30
Ankush Menat
22149b5bff chore: increase communication limit
This needs better fix, added temporarily
2023-06-13 12:12:21 +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
Ankush Menat
2ed2f8747d chore: track doc creation
This is alternate to "Activation" level that already exists, activation
level will be phased out over time.
2023-05-29 13:34:24 +05:30
Shariq Ansari
89186b8057 fix: multiple assignments to the same person 2023-04-24 11:30:35 +05:30
Marica
90f8f945b4
feat: Disable Sharing globally (#20318)
* feat: Disable Sharing globally

- Checkbox in System Settings
- If disabled, avoid share UI render
- Share APIs return None (non-obstructing) if share APIs are invoked

* feat: Settings checkbox must toggle share permission globally

- Treat feature like a perm toggler. Essentially noone is allowed to explicity share anything
- Implicit sharing via `ignore_share_permissions` is allowed. Devs can decide where sharing should happen under the hood
- UI is made read only and not hidden. Users must see who doc is already shared with
- Make sure perm APIs used by share feature return false if sharing is disabled
- Rename checkbox to `Disable Document Sharing`

* test: (server side) Impact of disabling sharing on APIs

- Also, fix missed system setting rename in `assign_to`

* fix: Inform assigner if assignee lacks perms and sharing is disabled

- misc: readable conditions

* fix: throw instead of msgprint

* fix: Typo and appropriate message for `throw`

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-28 18:13:37 +05:30