Commit graph

3361 commits

Author SHA1 Message Date
Akhil Narang
da1fb2ff4e
fix(event/sync_communication): add distinct while querying communication links
There's cases where these are duplicated

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-21 13:01:19 +05:30
TechnicalShree
90cf6bb829
feat: Enabling Redirection to a Custom URL on Notification Click (#22956)
* feat: notification custom routing

* Update frappe/public/js/frappe/ui/notifications/notifications.js

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

* code refactoring

* field name correction

* fix: json

* fix: auto generation

* lint fix

* fix: lint

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-11-21 01:23:41 +05:30
Akhil Narang
eb45da3913
feat: Allow usage of print() within safe_exec() (#23084)
* feat(safe_exec): allow usage of `print()`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* refactor(system_console): update description to mention `print()` instead of `log()`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* feat: unconditionally add debug logs to response if present

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* chore(safe_exec): add in a test for running `print()` within safe_exec

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix(safe_exec): ignore warning

RestrictedPython warns us if we call `print()` don't use their `printed` variable

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* feat: store debug logs from scheduled jobs

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix: avoid ignoring warnings, disabled in prod anyway

* chore: remove unnecessary logging

This can be moved to level 2 when required

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-11-20 12:45:41 +05:30
sibi kumar k
c3b0da60d1
feat: Add image view in Workspace shortcut block (#23041)
* Feat:Add image view in Workspace creation

* image view condition
2023-11-20 11:56:05 +05:30
Shariq Ansari
c0d47d8ddd
chore: linter fix 2023-11-20 11:46:09 +05:30
barredterra
20ef73302c fix: disable only save button, not the entire form
Disable form is a one way street and cannot adapt to changed conditions
2023-11-09 13:48:34 +01:00
barredterra
69e95edc6f fix: don't copy value of "Is Standard"
The field becomes read only in production, so after
"Menu" > "Duplicate", it wasn't possible to disable
"Is Standard " for the copy.
2023-11-09 13:47:07 +01:00
barredterra
33b23022d4 fix: move field description to doctype definition 2023-11-09 13:41:22 +01:00
mergify[bot]
d3c534e0cf
fix: attempt to not pass an empty string to json.loads (#23139) (#23141)
* fix: attempt to not pass an empty string to `json.loads`

* fix: ignore all falsy fields

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 6a8cf0689ae8e70f99ffd6957603d6583b4bdf92)

Co-authored-by: Arjun <contact@arjunchoudhary.com>
2023-11-07 20:04:20 +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
Ankush Menat
86e4a3a6e1 fix: Respect "Do Not Track" settings
Don't offer telemetry as option if DNT is set in browser.

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack
2023-11-01 15:07:27 +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
Vishnu VS
e06200400f
feat: added "Dashboard Chart" button (#22960) 2023-10-30 18:30:03 +05:30
Ankush Menat
d196dfeac4 fix: ignore perm while updating notification settings
If you can update user, do you should be able to update notif settings.
2023-10-25 11:22:56 +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
Shariq Ansari
f5a8b33162
Merge pull request #22789 from shariquerik/workspace-security-fix 2023-10-17 19:59:54 +05:30
Shariq Ansari
c955cba894 fix: allow hiding/unhiding others private workspace if you are workspace manager 2023-10-17 19:40:57 +05:30
Shariq Ansari
7343c83838 fix: do not allow editing other's private workspaces 2023-10-17 19:39:53 +05:30
Shariq Ansari
f1c394cafc fix: do not allow creating private workspace for other users 2023-10-17 19:38:42 +05:30
Shariq Ansari
1b1c11ad5e fix: do not allow deleting other's private workspaces 2023-10-17 19:13:56 +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
Suraj Shetty
330fde3dcf
Merge pull request #22637 from bosue/todo_quickentry_with_duedate 2023-10-17 16:23:36 +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
Ankush Menat
dfcb69ab21 refactor: use reportview get_count implementation
Count reported should be according to permissions
2023-10-16 18:13:50 +05:30
Ankush Menat
47538f7601 feat: doctype collection level APIs - meta, count 2023-10-16 18:13:50 +05:30
ruthra kumar
d06a5808cc
fix: validation permission on tag creation (#22753)
* fix: validation permission on `tag` creation

* refactor: apply checks on all operations

Add/remove both are controlled by update

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-10-16 12:38:00 +00:00
Ankush Menat
db3e4c9cfc
fix: Check if note has permission (#22750) 2023-10-16 16:43:47 +05:30
Ankush Menat
c476c5e6d7
refactor!: Link field search (#22745)
* refactor!: Drop handling for SQL queries

This hasn't been supported in really long time, no need to check that
use cases.

It will still fail but with no special error message.

* fix: Catch all import related errors

* fix!: Use last query from hooks

* refactor!: Return search results like any other function

Search results are returned in `results` key which is incosistent from
most other functions

* refactor: simplify search_link
2023-10-16 15:41:02 +05:30
Ankush Menat
55a444959e fix: Make search_link query postgres compatible 2023-10-16 11:51:51 +05:30
Ankush Menat
fec7759d00 fix: Give idx higher preference than meta order
Meta order in most cases is default "modified" which doesn't quite help.

idx is # of times a document is referred to somewhere else, which is
more likely to be relevant.
2023-10-16 10:50:57 +05:30
Ankush Menat
31444228c3 fix: Improve search relevance for search_link
When `locate` returns 0 it's shown on top instead it should be shown
last or not shown at all.

This is math hack to avoid using any complex SQL functionality which
isn't allowed in DB query.
2023-10-16 10:46:47 +05:30
Bernd Oliver Sünderhauf
da6c42bb63 fix(UX): Add 'Due Date' to Quick Entry Form, default to Today. 2023-10-14 01:17:41 +02:00
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
Suraj Shetty
c8f3389ba7
Merge pull request #22439 from dhiashalabi/fix-child-table-select-search-link-permission 2023-10-10 13:32:45 +05:30
ruthra kumar
f6d9069fb1 fix: keyerror on reports with subtotal 2023-10-08 17:22:29 +05:30
Shariq Ansari
9bafe1f558
Merge pull request #22408 from RitvikSardana/develop-ritvik-add-column-fix 2023-09-26 12:30:10 +05:30
Suraj Shetty
f374771361
Merge pull request #22191 from maharshivpatel/feat-desk-refresh 2023-09-22 12:56:11 +05:30
Daizy Modi
3b8aca1a43
feat: provision to set_route for Custom Number Card (#21806) 2023-09-21 18:38:43 +05:30
Maharshi Patel
37f03069bf
Merge branch 'develop' into feat-desk-refresh 2023-09-20 22:24:33 +05:30
Anand Baburajan
5004374ecc
chore: handle invalid connections conf for internal links (#22486)
* chore: handle invalid connections conf for internal links

* chore: remove unnecessary None
2023-09-20 11:14:51 +00:00
Bernd Oliver Sünderhauf
67376e26d4
fix: Set system timezone for Administrator and Guest users. (#22440)
* fix: Set system timezone for Administrator and Guest users.

* refactor: use constant instead of duplicating

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-20 15:26:00 +05:30
Corentin Flr
15010cf8a9
fix: Fix typo in form_tour (#22474) 2023-09-20 13:22:09 +05:30
Suraj Shetty
7905423128
Merge pull request #22446 from surajshetty3416/fix-dashboard-chart-permission 2023-09-19 15:33:25 +05:30
Shadrak Gurupnor
c4afd035e8
feat: view committed queries in console log (#22466)
* feat: show committed queries in console log

* chore: typo
2023-09-19 14:38:23 +05:30
Ankush Menat
1ebbbc772e Merge branch 'develop' into feat-desk-refresh 2023-09-18 21:05:37 +05:30
RitvikSardana
7ae5ffca19 chore: code cleanup 2023-09-18 18:24:43 +05:30