Commit graph

226 commits

Author SHA1 Message Date
Ankush Menat
3896296c6f fix: update sort order in doctypes 2024-03-27 11:18:28 +05:30
Ankush Menat
071e269548 fix!: Switch to creation as default sort order 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
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
Ankush Menat
7580125bae fix: Filter auto repeat doctypes 2024-02-02 18:57:47 +05:30
barredterra
9fa409eae4 fix: translatability 2024-01-26 19:02:44 +01:00
Rushabh Mehta
d1f2f42015 fix(minor): move missing settings to tools 2024-01-02 15:47:53 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
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
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
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
Ankush Menat
dc8d7b019a refactor!: Lower roles from All To Desk User 2023-08-29 12:07:57 +05:30
Ankush Menat
b358c94a2e chore: use doc to update references 2023-08-28 11:16:12 +05:30
barredterra
c1901dbf72 test: assignment rule on_submit / cancel 2023-08-15 15:17:15 +02:00
Ankush Menat
a3c7358f66 fix: check permission on autorepeat 2023-08-13 18:27:34 +05:30
gavin
453690ecc0
fix(types): Exporter unconditionally marks fields as Nullable (#21997)
* fix(types): Exporter unconditionally marks fields as Nullable

* fix: correct fieldtype names

* fix: table multi-select type annotations

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-08-10 10:18:10 +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
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
927cd647e4 chore: generate type annotations 2023-07-24 15:32:48 +05:30
Shariq Ansari
75b26cc96b revert: do not create comm on auto repeat #20606 2023-07-13 16:15:25 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Nabin Hait
af7502bba7
refactor: Workspace cleanup (#21100)
* refactor: Workspace cleanup

* fix: Resolved conflict
2023-05-26 14:42:31 +05:30
Suraj Shetty
bd737d3616
Merge branch 'develop' into fix-note-2 2023-05-16 07:53:15 +05:30
Ritwik Puri
ab6e74e37d
fix: strip comma, space from recipients before sending email for auto repeat (#20940) 2023-05-09 18:29:13 +05:30
Suraj Shetty
3028918f98
Merge branch 'develop' into fix-note-2 2023-04-17 13:19:48 +05:30
Ritwik Puri
a3bc93e928
fix: dont create communication for auto repeat notification (#20606)
* fix: dont create communication upon auto repeat notification

creating communication for notification doesnt make sense

* test: rename test_notification_is_attached -> test_email_notification

now tests for email queue creation
2023-04-07 01:55:51 +05:30
Raffael Meyer
b84ab9de87
Merge branch 'develop' into fix-note-2 2023-02-24 12:13:58 +01:00
Ankush Menat
e7f604ef48 refactor: rename DocReminder -> Reminder 2023-02-24 13:47:58 +05:30
Ankush Menat
73cd823a0a feat: Document Reminders
There is `Notification` doctype but it doesn't work so well for small
one-off reminders. Imagine these scenarios:

1. Remind me to follow up on this lead in 5 days.
2. Remind me to revoke temporary access I am giving to this user.

For such scenarios, I am proposing a simple reminder system built into
framework. All it does is:

1. For any document you can set a reminder with time and message.
2. When time comes you'll get a system notification with message and
   link to the document.

Permissions:
1. Users can only see their own set reminders.
2023-02-24 12:40:54 +05:30
Raffael Meyer
a41c7f7528
Merge branch 'develop' into fix-note-2 2023-02-01 17:31:13 +01:00
barredterra
636b85174e fix: test assignment rule 2023-01-17 19:49:43 +01:00
Gavin D'souza
d1fb60edfb test: Remove auto_repeat custom field in cleanup 2023-01-11 11:47:30 +05:30
barredterra
d0f75363a5 refactor: make test for assignment independent of Note 2022-12-20 16:30:11 +01:00
Ankush Menat
a90fc27c75
refactor!: Remove activity feed (#19241) 2022-12-12 15:29:32 +05:30
phot0n
25c0f606d5 refactor: remove event streaming doctypes from Tools workspace 2022-08-26 00:39:41 +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
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Ankush Menat
41af9621cd test: undo custom field creation 2022-08-17 16:39:42 +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
Ankush Menat
261fbfcd11
Revert "fix(doc)!: Always cast datetime, date and time fields"
Revert "fix(doc)!: Always cast datetime, date and time fields (#15891)"

This reverts commit d7789ab6ff.
2022-07-05 13:43:32 +05:30
Himanshu
d7789ab6ff
fix(doc)!: Always cast datetime, date and time fields (#15891)
### BREAKING CHANGE
#### Datetime, Date and Time fields will always be cast to respective objects in `setattr`, this will ensure uniformity while accessing the values, no more `getdate`, `get_datetime`, `to_timedelta` wrapper.
- While importing data, the framework does check for `set_only_once`.
- In normal case scenarios, this will work flawlessly since most date fields might not be set_only_once.
- But in Subscription, the date field is set to `set_only_once` and in `after_insert`, `document.save` is called, and while doing so, `set_only_once` is checked [here](1944a547f9/frappe/model/document.py (L566)).
-This works fine if the data imported is in the correct format.
- If the date's data is not in the correct format, the framework throws an error.
- for eg `06-02-2022 00:00:00 != 06-02-2022`
- fixes [Issue/#15370](https://github.com/frappe/frappe/issues/15370)

> no-docs
2022-07-05 07:07:16 +00:00
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
Gavin D'souza
1b1479ef37 fix(email): Maintain multi-tenancy translation sanity in error messages
Defining translated strings as globals means the strings are evaluated
at import time. So the value of these variables is set based on which
site or user initializes the module. This makes it possible for  an
english user to get Russian errors.

---

Other changes: Remove unreachable code, avoid importing _socket.error alias to
OSError
2022-06-07 13:22:45 +05:30
Rushabh Mehta
6e6fe9521e fix(linting): no single quotes :'| 2022-04-18 17:29:03 +05:30
Rushabh Mehta
57a55e4225 feat(minor): Add document reference to Error Log and doc.log_error 2022-04-18 17:29:03 +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
Shariq Ansari
da105f5ab4
Merge branch 'develop' into wspace-new-design 2022-01-24 10:50:59 +05:30