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
This action was broken into some heavy UI stuff that seems to be handled
from the current UI from what I can tell and a request triggered from
the Desk for every suspected linked document (talk about self DOS xD)
Removed long dead with_doctype option in get_linked_docs API. How do i
know it's been long dead? I've not come across code that won't very
obviously break when hit with any non None value.
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.
* 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
When list of docs is of same length as list of doctypes to ignore, the
formula would throw ZeroDivision error. It's meaningless to subtract
these two quantities hence removed it.
Showing accurate progress bar would require pre-computing number of docs
to be cancelled, which is unnecessary.
Related issue: ISS-20-21-10442
- show all linked doc in a dialog box on cancel event
- following changes only fetch cancelable docs
- recursively build a list of linked submitted docs
- cancel all linked documents before cancelling current document
- add progress bar and group documents by doctype
- added exempted doctype list in hooks
* feat(control): Add Table MultiSelect control
* fix: Use btn-group instead of span
* fix: Remove functionality
* fix: Add 'Table MultiSelect' to Field doctypes
* fix: Replace usage of string 'Table' with array `table_fields`
* fix: Use internal array to store values instead of building from HTML elements
* fix(style): Add semicolon
* fix: Read only mode and click to navigate to form
* style: indent
* fix: fallback to empty array
* fix: Add formatters in js and py
* style: missing semicolon
* fix: Add docfield validation
* Overwrite "if owner" restriction*
- Overwrite "if owner" restriction if user has other valid roles
(with access rights) without if_owner enabled for it in doc perm
eg:
If a doctype has 2 docperm for Role A and Role B and the docperm with
Role A has if owner enabled.
Suppose User 1 has Role A, then User 1 should see only docs
which was created by him.
Now if User 2 has Role A and Role B, User 2 should be able to see all the
records because Role B has unrestricted access on doctype.
------------------------------------------------------
Previously in case of User 2, the restriction(of if owner) from Role A
used to reflect and User 2 was only able to view only records made by
him.
This commit will overwrite the if_owner restriction in such case.
- Refactor get_role_permission method
* Add advanced control for user permission
- Add ability to skip user permission check for specific doctype
* Refactor "linked with" method
- Add option to skip linked with doctype which has
ignore_user_permission enabled against them.
* Clear "linked with doctype" cache on doctype changes
* [Minor] Fix formatting
* Fix error and bugs in linked_with method
* Format code
* Add fix to get allowed docs from user_permission
* Fix has_user_permission bug
* Add before migrate patch for user permission
* Fix typo