Commit graph

41518 commits

Author SHA1 Message Date
Wolfram Schmidt
492fdbeec4
chore: Update de.csv (#20545)
added translations related to Navbar-Settings. Cleanup.
2023-04-03 11:23:34 +05:30
Wolfram Schmidt
3d626dd364
chore: Update de.csv (#20546)
alligned singular and plural. Has effect on DocType naming of DocType Notification!
2023-04-03 11:23:12 +05:30
Ankush Menat
5fff6698ad fix: use develop as branch name for new apps
dont ask me why
2023-04-02 15:26:32 +05:30
Marica
f206b1582e
test: Kanban Test fails to remove System Manager role (#20505)
* fix: Kanban Test fails to remove System Manager role

- As there's only one user with System Manager role, role removal is reverted
- Add another user with this role, so that role removal on test user works

* chore: Reuse `create_test_user` util

* fix: user switching in kanban test

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2023-04-02 15:14:40 +05:30
Shariq Ansari
d35e486124
Merge pull request #20549 from shariquerik/align-chart-link-card 2023-04-02 15:11:38 +05:30
Ankush Menat
10dcbc5ecf fix: fix address query for postgres
refer https://github.com/frappe/frappe/pull/20537#ref-pullrequest-1645575433
2023-04-02 15:10:54 +05:30
Shariq Ansari
b72ec114ee fix(UI): align link cards & charts on workspace 2023-04-02 14:33:35 +05:30
Raffael Meyer
ae3b3ebb17
chore: remove excessive whitespace (#20544)
to make the linter happy

[skip ci]
2023-04-01 22:22:03 +05:30
Ankush Menat
b9e994b297
Merge pull request #20537 from ankush/perf/address_query
perf: Faster address query with explicit joins
2023-03-31 19:06:12 +05:30
Ankush Menat
fba3497ba0 test: address query 2023-03-31 19:04:11 +05:30
Ankush Menat
09e32c3085 perf: Faster address query with explicit joins
This querry is particularly problamatic when there are OR conditions due
to shared docs.

```sql
ANALYZE SELECT `tabAddress`.name,
       `tabAddress`.city,
       `tabAddress`.country
FROM `tabAddress`
join `tabDynamic Link` on (`tabDynamic Link`.parent = `tabAddress`.name AND `tabDynamic Link`.parenttype = 'Address')
WHERE
  `tabDynamic Link`.link_doctype = 'Customer'
  AND `tabDynamic Link`.link_name = 'CUSTOMER NAME'
  AND coalesce(`tabAddress`.disabled, 0) = 0
  AND (`tabAddress`.`country` like '%%'
       OR `tabAddress`.`state` like '%%'
       OR `tabAddress`.`name` like '%%'
       OR `tabAddress`.`name` like '%%')
  AND ((((coalesce(`tabAddress`.`branch`, '')=''
          OR `tabAddress`.`branch` in ('something')))))
  OR (`tabAddress`.name in ('SOME SHARED DOC'))
ORDER BY if(locate('', `tabAddress`.name), locate('', `tabAddress`.name), 99999),
         `tabAddress`.idx DESC,
         `tabAddress`.name
LIMIT 0, 20;
```

**Before:** Never terminates and reads entire table with millions of lines :LOL:

**After:** Reads ~100 rows max.

```
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: tabDynamic Link
         type: index_merge
possible_keys: parent,link_doctype_link_name_index,link_name
          key: link_name,link_doctype_link_name_index,parent
      key_len: 563,1126,563
          ref: NULL
         rows: 40
       r_rows: 79.00
     filtered: 100.00
   r_filtered: 100.00
        Extra: Using union(intersect(link_name,link_doctype_link_name_index),parent); Using where; Using temporary; Using filesort
*************************** 2. row ***************************
           id: 1
  select_type: SIMPLE
        table: tabAddress
         type: eq_ref
possible_keys: PRIMARY,selco_branch
          key: PRIMARY
      key_len: 562
          ref: _900a733bdc3bb9ed.tabDynamic Link.parent
         rows: 1
       r_rows: 1.00
     filtered: 100.00
   r_filtered: 100.00
        Extra: Using where
2 rows in set (0.001 sec)
```

<!--

Some key notes before you open a PR:

 1. Select which branch should this PR be merged in?
 2. PR name follows [convention](http://karma-runner.github.io/4.0/dev/git-commit-msg.html)
 3. All tests pass locally, UI and Unit tests
 4. All business logic and validations must be on the server-side
 5. Update necessary Documentation
 6. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes

Also, if you're new here

- Documentation Guidelines => https://github.com/frappe/erpnext/wiki/Updating-Documentation

- Contribution Guide => https://github.com/frappe/frappe/blob/develop/.github/CONTRIBUTING.md

- Pull Request Checklist => https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist

-->

> Please provide enough information so that others can review your pull request:

<!-- You can skip this if you're fixing a typo or updating existing documentation -->

> Explain the **details** for making this change. What existing problem does the pull request solve?

<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->

> Screenshots/GIFs

<!-- Add images/recordings to better visualize the change: expected/current behviour -->
2023-03-31 17:46:06 +05:30
Ankush Menat
5ad9350b14
fix: Handle JsBarcode exceptions (#20533)
JsBarcode exceptions prevent entire page from loading. Instead of that
catch error and show it in helpbox so user can correct the barcode if
required.

Steps to reproduce:
1. Add barcode field
2. Set barcode type in options
3. add invalid barcode and save

(cherry picked from commit 57d40b2614068c13b4b14f42438b46b22c0f5533)
2023-03-31 14:37:51 +05:30
Suraj Shetty
9b6ceab68c
Merge pull request #20530 from ankush/bump_redis 2023-03-31 14:06:36 +05:30
Suraj Shetty
06cb58aa85
Merge branch 'develop' into bump_redis 2023-03-31 14:04:02 +05:30
Suraj Shetty
7a92a604e0
style: Fix formatting 2023-03-31 14:03:49 +05:30
Suraj Shetty
f46d16713f
Merge pull request #20115 from pstuhlmueller/email_sent_as_cc_to_todo_allocated_users 2023-03-31 13:49:04 +05:30
Ankush Menat
c509983ca4 build: bump redis version
https://github.com/redis/redis-py/releases
2023-03-31 13:37:55 +05:30
Suraj Shetty
aab37e0a6c
fix: Check if reference_name is set 2023-03-31 13:31:18 +05:30
Himanshu Shivhare
2cb492561a
fix(ux): correct email account setup path in error message (#20513) 2023-03-30 17:57:00 +05:30
Raffael Meyer
9758781f80
fix: bulk update using doc method, check perms (#20522)
* fix: bulk update

* fix: always check permission
2023-03-30 17:10:44 +05:30
Sagar Vora
1cbb60adf9
Merge pull request #20508 from resilient-tech/escape-html
fix: escape HTML instead of sanitizing
2023-03-30 07:05:31 +00:00
Sagar Vora
a56ea73b7d fix: escape HTML instead of sanitizing 2023-03-30 06:27:07 +00:00
Raffael Meyer
40ad983598
feat(contact template): clickable email ids and phone numbers, less labels (#20247)
* refactor(contact template): use for .. of loop

* refactor(contact template): clickable phone numbers and email ids

* refactor(contact template): less labels

* fix: escape phone and email ids
2023-03-29 13:01:32 +05:30
Ankush Menat
45c86e2ff8
fix: nestedset rename (#20498) 2023-03-29 12:49:28 +05:30
Raffael Meyer
6096e45b36
test: switch tests to supported methods (#20494)
* fix: switch tests to supported methods

get_fetch_fields, update_linked_doctypes

* test: semantic assertions

* test: fixup deprecation tests imports

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-29 10:31:01 +05:30
Ankush Menat
513a209d53 test: fix test case to modified behaviour
We throw instead of showing warning now
2023-03-29 09:25:20 +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
Ankush Menat
63338a3806
fix: date field shouldn't be formatted for TZ (#20486)
Date fields aren't timezone aware.
2023-03-28 17:33:05 +05:30
Saqib Ansari
e756d41790
chore: add insights banner (#20487)
* chore: add insights banner

* chore: cleanup message and title

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-28 17:24:20 +05:30
Devin Slauenwhite
6bda014406
fix: install cypress plugins in frappe namespace (#20459) 2023-03-28 14:34:45 +05:30
Ankush Menat
024faff025
build: bump pymysql (#20478)
Actual fix for this bandaid fix: https://github.com/frappe/frappe/pull/20475

Keeping pymysql hard pinned until we have better way to get last full
query.
2023-03-28 13:04:27 +05:30
Ankush Menat
229dcb3c91
fix: pin pymysql to avoid breaking behaviour (#20475)
```
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/database.py", line 920, in get_default
    d = self.get_defaults(key, parent)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/database.py", line 936, in get_defaults
    defaults = frappe.defaults.get_defaults_for(parent)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/defaults.py", line 222, in get_defaults_for
    .run(as_dict=True)
     ^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/query_builder/utils.py", line 85, in execute_query
    return frappe.db.sql(query, params, *args, **kwargs)  # nosemgrep
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/database.py", line 264, in sql
    self.log_query(query, values, debug, explain)
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/mariadb/database.py", line 203, in log_query
    self.last_query = query = self._cursor._last_executed
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Cursor' object has no attribute '_last_executed'. Did you mean: '_check_executed'?
```
2023-03-28 12:07:13 +05:30
Samuel Danieli
dc4509796d
fix: suggested email ids in New Email dialog (#20319)
* chore: enhance UX of New Email dialog

* do not show contacts without an email
* use name as value, y? if several contacts use the same email address, the entry will be displayed several times, but always with the same description, which leads to confusion - using name as value makes the entries distinguishable

* chore: ignore semgrep

Rewriting the query is not in the scope of this PR.

* chore: keep semgrep failing on raw query

[skip ci]

* fix: use email_id as value

* Revert "fix: use email_id as value"

This reverts commit e4c44e2094ddb9b525bc34d400642dcee5656096.

* chore: comment confusing code

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-03-28 11:47:56 +05:30
Rutwik Hiwalkar
69b22f3af2
chore: add ascending order to querybuilder (#20471) 2023-03-28 00:01:42 +05:30
Saqib Ansari
32dbbb47bf
feat: redis cache decorator (#20452)
* feat: redis cache decorator

* fix: review changes

* fix: remove unintentional changes

* fix: remove unintentional changes

* refactor: cleanup and simplify code for redis

AIs suck

* fix: bug

* test: redis cache

* fix: remove unused import

* feat: make redis cache user specific

redis cache utils already support this, extending so everyone can use it

* feat: support @redis_cache without params

* test: flake in request site cache test

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-27 17:03:20 +05:30
Ankush Menat
f089e9108e
fix: hard link environment variable (#20467)
On docker based deploys symlinking inside volume doesn't work.

[skip ci]
2023-03-27 15:58:43 +05:30
gavin
86f7219525
fix: Auto-Reload after changing time zone (#20456) 2023-03-24 21:02:30 +05:30
Ritwik Puri
d9383afae6
fix: exception handling for bulk email sending (#20451) 2023-03-24 13:45:46 +05:30
Ankush Menat
543a4c467b fix: social media links
[skip ci]
2023-03-24 12:50:36 +05:30
Himanshu Shivhare
0ec7ea45e9
fix: Update social media links (#20400)
* YouTube channel addded in about section. 

I have added ERPNext YouTube channel reference in the about section.
#Create an official Handle for YouTube Channel (Like @erpnext or erpnextofficial)

* chore: handle

[skip ci]

* Update about.js

YouTube channel name changed.

---------

[skip ci]
2023-03-24 12:49:42 +05:30
HarryPaulo
0374d37c62
feat: show if address is "Disabled" (#20446) 2023-03-24 12:43:09 +05:30
Ankush Menat
6b3d283cf7
fix: unsubscribe from list_update before resubbing (#20450)
resubbing can result in multiple events being fired, so unsubscribe all
of them before re-subscribing.

missed in https://github.com/frappe/frappe/pull/20423
2023-03-24 09:58:19 +05:30
Raffael Meyer
f7f575acbd
ci: copy docs checker from erpnext (#20441)
[skip ci]
2023-03-24 08:53:34 +05:30
Leonard Goertz
bd049a42a3
fix: fields are rendered empty after save (#20270)
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-24 08:44:34 +05:30
Ankush Menat
f8533010da
Merge pull request #20442 from ankush/perf/can_subscribe
perf: dont re-initate session in realtime.py
2023-03-23 18:14:51 +05:30
Shariq Ansari
806df53222
Merge pull request #20432 from shariquerik/avoid-list-refresh-fix 2023-03-23 18:12:18 +05:30
Shariq Ansari
6763f63455
Merge branch 'develop' into avoid-list-refresh-fix 2023-03-23 17:53:52 +05:30
Shariq Ansari
6e3ef3dc3d test: fixed failing UI test 2023-03-23 17:53:18 +05:30
Ankush Menat
3f717f2fbd perf: Don't re-initate sessions in realtime.py
Session is already created for all requests in app.py -> init_request -> HTTPRequest()
2023-03-23 16:55:09 +05:30
Ankush Menat
5a91ac945c fix: doctype form - hide irrelevant fields 2023-03-23 16:16:14 +05:30