Commit graph

207 commits

Author SHA1 Message Date
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
hrwx
b01929405d refactor: translatable doctypes 2022-08-05 21:38:10 +01:00
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
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
28fd355f24 chore: translate before searching doctype 2022-06-20 11:16:24 +05:30
Ankush Menat
e0e452bdcc
fix: incorrect filtering on address doctype (#17241)
[skip ci]
2022-06-20 11:11:10 +05:30
Ankush Menat
8c6d266fad fix: can't select dynamic link on address doctype 2022-06-17 14:43:02 +05:30
Gavin D'souza
963648667d refactor: filter_dynamic_link_doctypes API
* Added typing, better variable naming
* Remove unnecessary re-iterations
* Optimize queries and membership processing
2022-06-13 18:39:56 +05:30
chillaranand
1d763a6659 refactor: Fix flake8 issues 2022-05-19 15:34:35 +05:30
Himanshu
5ac729252f
fix: change ordering to creation (#16863) 2022-05-10 19:41:11 +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
Suraj Shetty
57df0bad82 fix: Check permission for address and contact list 2021-10-28 15:14:53 +05:30
Suraj Shetty
3728e6dfdb fix: Use get_all instead of get_list for doc creation to avoid permission check 2021-10-26 12:40:37 +05:30
barredterra
37a1a15b87 fix: set correct title
(cherry picked from commit b35391d339b2e2be15f1615011e5ea609eba01f5)
2021-09-27 06:02:29 +00:00
Suraj Shetty
39dfb96ff8
Merge pull request #14152 from anupamvs/address-spacing 2021-09-09 12:30:53 +05:30
Anupam
35d563edb0 fix: contact.py spacing issue 2021-09-09 11:50:47 +05:30
Anupam
6ca2788cc5 fix: spacing issue 2021-09-09 11:48:20 +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
65864c027f chore: Update module license header
These modules were imported from the ERPNext codebase into Frappe.
License header was overlooked at that point. These were contributed
initially by Frappe Technologies Pvt Ltd under GPLv3 (ERPNext's license) and now
we, as Frappe Technologies Pvt Ltd converting them to MIT to comply with
Frappe's license.
2021-09-03 11:51:01 +05:30
Gavin D'souza
c489846547 Merge branch 'develop' into unnecessary_comprehensions 2021-06-11 19:30:23 +05:30
Gavin D'souza
651a9ff42e fix: Return address 'name' instead of 'parent' field 2021-05-28 21:43:07 +05:30
Gavin D'souza
bd6fcddd04 chore: Drop unreachable code 2021-05-26 16:41:32 +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
Gavin D'souza
e8cf96d1d3 fix: Replace cmp with different logic
cmp was being used from past.builtins library since it was deprecated in
PY2. It's hard to understand behaviour of their usages, so this is an
attempt to replicate behaviour with simpler logic, making this more
readable.

Also, removed usages of iteritems and string_types, compatibility
imports
2021-05-26 13:25:01 +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
Suraj Shetty
57166b9964 test: Fix test dependencies 2021-05-05 13:15:52 +05:30
Frappe Bot
d30596b15e refactor: Delete Qunit test files
Since it is no longer used
2021-04-27 21:37:15 +05:30
Andy Zhu
138c7841c2
fix: set_primary and set_primary_email bug (#12299)
* fix: set_primary and set_primary_email bug

When user untick the `is_primary_phone` or `is_primary_mobile` from the contact numbers table, we should reset the phone, mobile number etc.
Same goes for the email address table.

* Update frappe/contacts/doctype/contact/contact.py

fix variable naming as suggested

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

* Update frappe/contacts/doctype/contact/contact.py

fix variable naming as suggested

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

* Update frappe/contacts/doctype/contact/contact.py

fix variable naming as suggested

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

* Update frappe/contacts/doctype/contact/contact.py

fix variable naming as suggested

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

* Update frappe/contacts/doctype/contact/contact.py

fix variable naming as suggested

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

* Update frappe/contacts/doctype/contact/contact.py

fix variable naming as suggested

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

* test: Set empty string instead of none for number

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2021-03-10 05:02:50 +00:00
barredterra
3ad56b2d5f fix: fetch contacts in auto repeat 2021-02-03 15:46:00 +01:00
Suraj Shetty
b5d9c1e816 Merge branch 'develop' of https://github.com/frappe/frappe into rebrand-ui 2020-11-06 10:42:37 +05:30
sezanzeb
ea6ebd396b chore: State/Province for Address 2020-10-21 16:18:01 +02:00
Shivam Mishra
9e39a7464a Merge branch 'develop' of https://github.com/frappe/frappe into rebrand-ui 2020-10-21 11:55:13 +05:30
Abhishek Balam
e31162e9f1 fix: move get_shipping_address() from frappe to erpnext since it has no references 2020-10-14 21:10:16 +05:30
Abhishek Balam
37a3096b68 fix: remove serverside validation 2020-10-14 19:09:36 +05:30
Abhishek Balam
fb40044496 fix: moving 'is your company address' field to erpnext 2020-10-14 18:09:28 +05:30
Suraj Shetty
ba29d8d8b4 Merge branch 'develop' of https://github.com/frappe/frappe into rebrand-ui 2020-10-01 13:10:37 +05:30
Wolfram Schmidt
a4c7eb9620
Update salutation.json (#11501)
Abbility to merge salutations after creation. Usefull when Mistakes are made like "Mrs." and "Mrs"

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>
2020-09-21 15:04:08 +05:30
Suraj Shetty
7035eff6e3 Merge branch 'develop' of https://github.com/frappe/frappe into rebrand-ui 2020-08-27 19:32:57 +05:30
prssanna
b33471c35a fix: replace darkgrey with darkgray 2020-08-27 15:44:37 +05:30
Afshan
ce161b37f8 fix: contact not showing in form 2020-08-26 22:32:46 +05:30
Suraj Shetty
21a0cafe62
fix: Validate and sanitise whitelisted search methods using decorator (#11197)
* fix: Validate and sanitize whitelisted search methods using decorator

Co-authored-by: Prssanna Desai <prssud@gmail.com>
Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>

* refactor: Replace decorator name

Co-authored-by: Prssanna Desai <prssud@gmail.com>
Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>

Co-authored-by: Prssanna Desai <prssud@gmail.com>
Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>
2020-08-05 19:42:19 +05:30
Chinmay D. Pai
42daf5a905
chore: escape value and remove unused condition
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-20 19:05:43 +05:30
Chinmay D. Pai
28399ba94b
fix: check for searchfield in meta
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-16 15:41:29 +05:30
Chinmay D. Pai
1e6e305a37
fix: check if searchfield exists in default columns
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-16 15:36:07 +05:30
Chinmay D. Pai
907411d33f
fix: validate if field exists in meta before adding to query
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-16 15:33:04 +05:30
Suraj Shetty
0e1a8006ff
fix: Return empty array 2020-07-14 12:56:12 +05:30
Chinmay D. Pai
36d1b5f015
fix: check if field exists in meta before executing query
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-09 12:27:39 +05:30
Chinmay D. Pai
338151a7e5
fix: correctly format sql query
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-07 13:00:55 +05:30
Chinmay D. Pai
8ddfd2344d
chore: add search queries to whitelist
these functions are called through search widget and need to be
whitelisted to work

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-02 12:55:04 +05:30