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.
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.
* 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
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
- 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.
* 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>
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>