Commit graph

221 commits

Author SHA1 Message Date
barredterra
5280cc58f4 refactor: address query 2024-07-24 10:30:35 +02:00
barredterra
c4e35ba5be fix(Contact): set address query and buttons from links 2024-07-01 18:10:47 +02:00
gavin
9d73477e60
Merge pull request #26771 from barredterra/contact-vcard
feat: download Contact as vCard
2024-06-27 11:03:22 +02:00
barredterra
be29009e4a refactor: only one access log for bulk contact export 2024-06-26 20:03:25 +02:00
barredterra
e61f1f99d6 fix: check permission and create access log 2024-06-18 12:47:51 +02:00
barredterra
9d19701e56 feat: download contact list as vCards 2024-06-16 18:19:48 +02:00
barredterra
b53203e14c feat: download Contact as vCard 2024-06-16 17:49:16 +02:00
barredterra
be90d5556e feat: set the only email address as primary
Some features rely on the Contact having the primary email set. If the Contact has only one email address, we can mark it as primary automatically. Only if there are more than one  addresses available, the user has to choose which one should be set as primary.
2024-06-13 17:38:09 +02:00
Ankush Menat
b63295d25c
fix: contact link with autoincr (#26642) 2024-06-03 04:59:48 +00:00
Akhil Narang
1c6ba0cf82
fix(address_query): show search fields in description if set
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-05-31 11:36:10 +05:30
Akhil Narang
b0a7d62a9e
fix(address_query): use title field if set
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-05-27 13:56:12 +05:30
Ankush Menat
1defbf5be8
fix: Apply configured perms on address list (#26334) 2024-05-06 12:08:06 +00:00
Nabin Hait
6a6193a26b fix: Column 'creation' in order clause was ambiguous 2024-04-04 13:02:08 +05:30
Ankush Menat
3896296c6f fix: update sort order in doctypes 2024-03-27 11:18:28 +05:30
Corentin Flr
5563c925a5
feat(address): Add no_title param to get_condensed_address Jinja filter (#24949) 2024-02-23 05:46:14 +00:00
barredterra
bbd42839e3 fix: invite contact as user 2024-02-16 20:43:37 +01:00
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
7487df22c9 refactor: use frappe.get_system_settings
because it's cached and doesn't hit frappe.db at all.
2024-02-02 18:43:43 +05:30
David Arnold
608f2ed20b
test: make phone number unique bis (#24367) 2024-01-16 10:56:47 +05:30
David Arnold
62148f9ecd
test: make phone number unique 2024-01-14 16:51:14 +01:00
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
Ankush Menat
8129fe7268
fix: Avoid duplicate contact names (#23731) 2023-12-11 17:15:37 +05:30
Ankush Menat
c6371cbdd0 fix: increase length for address lines
140 char default limit is often not enough as demonstrated here https://github.com/frappe/frappe/issues/23259
2023-11-20 17:29:00 +05:30
Sagar Vora
e8cbf61e6a
fix: revert unintentional quick entry default for Address (#22974) 2023-10-30 15:23:25 +05:30
Ankush Menat
8df5402b1f refactor: change kwarg name
frappe.call is oversmart about this particular name
2023-10-17 22:06:56 +05:30
Ankush Menat
3e19fb36a7
refactor: Split address render function (#22784)
This function can be used as utility where permssion checks might not be
required.
2023-10-17 14:07:31 +00:00
Ankush Menat
bac5f76247 fix: Apply address all perm only if owner 2023-10-11 11:48:51 +05:30
rohitwaghchaure
34fe6661c0
fix: e-commerece test cases (#22663) 2023-10-09 11:49:41 +05:30
Deepesh Garg
99bec229fb chore: remove unintentional json updated 2023-10-02 16:51:09 +05:30
Deepesh Garg
89fa201d9b chore: remove unintentional json updated 2023-10-02 16:49:36 +05:30
Deepesh Garg
ca726a82b4 fix: Give All role permission to read/create own address and contact 2023-10-02 16:12:41 +05:30
Sagar Vora
20178bd3eb fix: improved validation for address and contact 2023-09-29 12:04:38 +05:30
barredterra
8a5d667c85 fix(Contact): use existing full name 2023-08-09 13:11:54 +02:00
barredterra
a4385be70c fix: pass email as value 2023-07-24 16:02:22 +02:00
Ankush Menat
927cd647e4 chore: generate type annotations 2023-07-24 15:32:48 +05:30
Raffael Meyer
b6cd6535db
feat: better Email search (#20323)
* refactor: get_contact_list

* test: get_contact_list

* feat: search all emails, not just the primary one
2023-07-17 00:40:17 +05:30
Sagar Vora
b4f1a2328b
fix: ignore naming series validation when generating repeated address name (#21568) 2023-07-10 10:51:55 +05:30
Suraj Shetty
d2b7f47709
Merge pull request #19734 from barredterra/load-address-and-contact-display 2023-05-24 15:39:04 +05:30
Marica
3b5ff3dbb7
fix: get_default_address must accept 'Nonetype' name (#21022) 2023-05-17 11:11:57 +05:30
Raffael Meyer
440cde45f7
refactor: get_default_address (#20962) 2023-05-16 08:51:50 +05:30
Ritwik Puri
4b103888a7
chore: remove default None from address_dict param 2023-05-06 22:48:19 +05:30
Ritwik Puri
88bdefcc30
fix: type hints for get_address_display (#20923) 2023-05-06 21:36:07 +05:30
Raffael Meyer
0473f7b44f
feat: helper method for address display (#20900) 2023-05-04 23:36:58 +05:30
Raffael Meyer
f5d79f0128
Merge branch 'develop' into load-address-and-contact-display 2023-04-21 13:17:46 +02:00
Ankush Menat
fa32b610d6
fix: rewrite query for postgres (#20557) 2023-04-03 14:47:45 +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
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