Commit graph

204 commits

Author SHA1 Message Date
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
Rushabh Mehta
acac60d061 fix(minor): allow auto close without permission check 2022-01-18 18:06:27 +05:30
Shariq Ansari
94869e8e69 fix: updated standard workspace json files 2022-01-13 18:40:36 +05:30
Gavin D'souza
6f2125fca6 Merge branch 'develop' of github.com:frappe/frappe into owner-unchange 2022-01-04 15:06:37 +05:30
shadrak gurupnor
6c6ff2c16d fix: overriding of owner of doc
feat: Fixed the dilemma of owner field in ToDo document
2022-01-04 13:39:16 +05:30
Gavin D'souza
322a777b59 fix(ux): Auto Repeat's validation message has grammatical fixes 2022-01-03 19:10:28 +05:30
Gavin D'souza
f7b5982919 test(assign_rule): Setup and teardown for local testing 2022-01-03 19:09:42 +05:30
Gavin D'souza
3a38456583 refactor(minor): Assignment Rule
* Simplified and refactored logic
* Added type hints for where it gets really unbearable :')
* Minor perf improvements & better API usages
2022-01-03 19:05:58 +05:30
Gavin D'souza
e3fc400fd4 refactor(minor): Override clear_cache instead of separate hooks
Clear cached maps via Document.clear_cache
2022-01-03 19:01:01 +05:30
Shariq Ansari
5d00602f06 fix: Removing unused code for worspace 2021-09-20 21:27:14 +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
ebc220db39 refactor(tests): frappe.db.delete > frappe.db.sql
Use frappe.db.delete wherever possible. Get rid of all the frappe.db.sql ;)
This commit focuses on the tests written under the doctype specific
tests
2021-08-19 19:50:48 +05:30
Samuel Danieli
1e38d5a281
fix: broken link 2021-08-16 18:55:09 +02:00
shariquerik
5bed8031a2 fix: removed padding code from wspace json files & patch 2021-08-10 17:52:42 +05:30
Shariq Ansari
1ab70d2145
Merge branch 'frappe:develop' into wiki-based-desk 2021-08-10 12:20:08 +05:30
shariquerik
bf4611e84b fix: updated wspace json files & minor onboarding fix 2021-08-06 14:07:22 +05:30
Ankush
257723cb0a
feat: PythonExpression and Python option with syntax validation for Code field types (#13707)
* feat: `PythonExpression` and `Python` options for `Code` fields

* fix: check python expressions in assignment rule

* fix: replace server script syntax validation

* fix: validate condition in workflow transition

Add PythonExpression in Options.
2021-08-06 04:10:09 +00:00
shariquerik
8475c6c426 fix: updated wspace json files 2021-07-08 17:41:22 +05:30
shariquerik
f2a91f5709 fix: updated wspace json files 2021-07-08 15:37:01 +05:30
Gavin D'souza
c489846547 Merge branch 'develop' into unnecessary_comprehensions 2021-06-11 19:30:23 +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
d8a4cf896b
perf: prefer set builder notation over constructor 2021-05-12 20:38:18 +05:30
Ankush Menat
4754ab71d1
perf(minor): remove unnecessary comprehensions
- remove several unnecessary comprehensions from functions that accept a generator.
- Using `[x for x in iter]` causes a list to be built first then passed to the outer function.
- `any` and `all` can take generator instead. This makes memory usage O(1) and actually makes these functions short-circuiting. E.g. if the first condition fails then `all` will immediately return false instead of evaluating all the entries.
- `sum`, `min`, `max` => memory usage become O(1)
- `list`, `set`, `.join()` => roughly halves memory usage, as list is not required to be built.
- lastly, it's two fewer characters to read/think about.
2021-05-12 20:38:18 +05:30