Commit graph

385 commits

Author SHA1 Message Date
Abdo
35c929afdb
refactor(money in words): translatable currency Name (#21672) 2023-07-27 17:21:57 +05:30
Ankush Menat
af03b76c88 perf: Preload and share common python modules 2023-06-24 21:24:02 +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
Smit Vora
db6a06d204
fix: make sure number is not zero for bankers_rounding (#21431)
* fix: make sure num is not zero for bankers_rounding

* test: rounding near zero

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-06-20 12:00:22 +05:30
Ankush Menat
3005e66e45 refactor!: Drop previously deprecated code 2023-06-13 16:00:43 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Ankush Menat
3df13ca392 feat: new operator - descendants of (inclusive)
Co-Authored-By: Faris Ansari <netchamp.faris@gmail.com>
2023-05-29 16:59:57 +05:30
barredterra
fcb705b41d chore: docstring for pretty_date 2023-04-11 15:50:17 +02:00
barredterra
9f1feaab02 refactor: pretty_date 2023-04-11 15:44:03 +02:00
Bread Genie
6248d8f062
fix(pretty-date): plural form when the value is 1 (#20619) 2023-04-11 10:56:52 +05:30
Suraj Shetty
ed7d6931ca fix: Update code to update links with campaign and medium 2023-03-20 23:42:50 +05:30
Ankush Menat
dd2ac72a9a fix: skip 0 for rounding 2023-03-13 14:16:39 +05:30
Ankush Menat
139d4a87b4 fix: corrected banker's rounding
closes https://github.com/frappe/frappe/issues/19570
2023-03-13 12:30:48 +05:30
Ankush Menat
97ca92e3d1
refactor: change rounding method names (#20299)
These are easy to understand.

Added third method for corrected banker's rounding.
2023-03-10 14:57:15 +05:30
Ankush Menat
9f6a6d74fb refactor: split rounding methods in functions 2023-03-08 14:09:50 +05:30
Ankush Menat
86b9ff4266 feat: Allow specifying rounding method in flt 2023-03-08 10:59:02 +05:30
Ankush Menat
48f63f53ab feat: configurable rounding methods 2023-03-08 10:44:44 +05:30
Raffael Meyer
036e1c94cd
feat!: remove deprecated timezone utils (#20255) 2023-03-06 19:56:57 +05:30
barredterra
c2c5449947 chore: deprecate timezone utils in v15 2023-03-05 15:58:13 +01:00
barredterra
b2e36634d6 refactor: rename get_time_zone to get_system_timezone 2023-03-04 19:30:03 +01:00
barredterra
3694e654a1 refactor: rename convert_utc_to_user_timezone to convert_utc_to_system_timezone 2023-03-04 19:02:25 +01:00
Suraj Shetty
1daa78d0a0
Merge pull request #20179 from surajshetty3416/newsletter-analytics 2023-02-28 19:42:56 +05:30
Ritwik Puri
e7f28b08c9
fix: cast primary value in compare util if fieldtype is present (#20092)
* fix: cast primary value in compare util if fieldtype is present

* test: add test for date & datetime filters when using evaluate_filters
2023-02-28 16:50:52 +05:30
Suraj Shetty
6c8f88b8cd refactor: Remove UTM references just set source in web page view to simplify things 2023-02-28 14:17:16 +05:30
Suraj Shetty
afd55a97fb fix: Web page view creation
- Set path from backend via "Referer" to avoid bad data
- Add visitor_id to improve unique visit detection
2023-02-28 14:15:41 +05:30
Suraj Shetty
7d5c98c206 feat: Add UTM tracking parameters to internal links in newsletters
- Also, extend web page view to store UTM tracking data.
2023-02-23 16:19:07 +05:30
Suraj Shetty
b397ec3858 feat: Track count of views on newsletter emails 2023-02-23 13:45:53 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Ankush Menat
e31db5d502
fix: handle tel: links in emails (#19635) 2023-01-17 20:31:06 +05:30
Ritwik Puri
27a2689678
fix: slug doctype when building url to report with filters (#19581) 2023-01-12 23:36:46 +05:30
Anand Baburajan
bc0abd9cfd
feat(util): add is_last_day_of_the_month (#18835)
* feat: add is_last_day_of_the_month
2022-11-10 15:18:49 +05:30
Ankush Menat
9c84d078fa fix: remove mariadb specific comments from column
MariaDB has additional syntax for comments which are like python.
2022-09-26 11:09:39 +05:30
Shariq Ansari
5cfcc4a075
fix: Chart date format on x-axis is inaccurate (#18191) 2022-09-21 16:20:44 +05:30
Ankush Menat
9f31723555 refactor: directly map function over lambda call 2022-08-16 10:53:28 +05:30
Ankush Menat
53af10a064 refactor!: python pretty_date consistent with JS
Python pretty date was ceiling month and week instead of flooring them,
this is incorrect AND inconsistent with popular JS library pretty date
that we use on client side
2022-08-16 10:53:28 +05:30
Ankush Menat
9de31d03c1 refactor!: timespan utils consistent output
BREAKING CHANGE:

- `get_year_ending` returns datetime.date instead of str
- `get_timespan_date_range` will always return datetime.date ranges
2022-08-16 10:53:28 +05:30
Ankush Menat
a88819230a refactor: convert get_timespan_date_range to use match 2022-08-16 10:53:28 +05:30
Shariq Ansari
c478673367
fix: allow to import time field (#17677) 2022-08-01 14:50:40 +05:30
Shariq Ansari
a50e0ffa08
refactor: Webform (#17232) 2022-07-19 15:52:15 +05:30
Ankush Menat
29c855b028
fix: db.get_value -> db.get_single_value (#17531)
db.get_value for singles returns string type always, this is confusing
behaviour, db.get_single_value should be used instead.

semgrep rule: https://github.com/frappe/semgrep-rules/pull/16
2022-07-18 15:10:49 +05:30
Suraj Shetty
34b1ea57f9 fix: Show "Queued" status on newsletter
Show "Queued" status on newsletter if emails are queued and "email sending" is not yet started.
2022-07-12 13:03:06 +05:30
Suraj Shetty
d4166dbe20 refactor: Replace html2text with markdownify 2022-07-06 08:23:14 +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
054ad9c30c feat: Allow showing currency symbol to the right 2022-07-05 11:21:23 +05:30
Ankush Menat
4e6ea5b554
fix: handle None as amount in fmt_money (#17395) 2022-07-04 16:27:57 +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
Ankush Menat
aad7ebc938
fix: extra notification triggered on value change (#17364)
Since value in DB and value on object can be in different type the
notification gets triggered unnecessarily

e.g. data(2012, 10, 10) != "2012-10-10"
2022-06-30 20:25:29 +05:30
Ankush Menat
d35d7ffbe2 fix: remove bare exception catching
A bare except catches lots of things (like generator iteration end) and should never be used.
2022-06-28 18:05:00 +05:30
Gavin D'souza
fc422f4a97 chore(deps): Bump Pillow from 9.0.1 to 9.1.1
Includes security fixes, API & constants deprecations

Changelog: https://pillow.readthedocs.io/en/stable/releasenotes/index.html
2022-06-10 13:12:35 +05:30