In python 2 writing to file can be done by reading the file as 'w' or
'wb', however, in python 3 if we're writing 'utf-8' encoded stuff to a
file, it needs to be opened using the 'wb' argument. 'b' here stands for
binary.
* Replace frappe.db.sql with frappe.get_list
- Permission check for treeviews
* Optimize get_role_permissions
- Avoid setting of roles each time when is_perm_appicable is called
* Fix codacy
- Remove trailing whitespace
* use multiselect for email dialog, improv email fetch query
* patch to create contact for all user
* append number if same name found for company
* update tests
Old implemetation involved 2 sql queries for every party_type, one for
address and one for contact. This was timing out if the party_type size
was too large. New implementation involves 3 queries only.
Stats:
no_of_records | party_type | old_time | new_time
--------------+------------+----------+---------
27000 | Customer | 209 secs | 1.5 sec
File types other than plain text files weren't sent properly in email. The initial implementation of try except used to destroy the file object in the try statement, and hence we were getting a blank string in the except block. The fix involves reading the file object separately before trying to decode it.
Added frappe wrappers to math.ceil and math.floor, since they are widely
used functions. Also added their docstrings for documentation and wote
test cases. And some minor typo fixes
* Fix auto dropdown for tag on page load
* Fix tag related bugs
- reset doc user_tags on change
- move "label conversion toTitle" from onTagAdd listener
to addTag function
- remove unnecessary refresh call
After execution of a bulk rename, the help cache for the particular
doctype didn't used to change. Added this fix to ensure the help is
rebuilt for the particular doctype whose docs have been renamed
* Check for list_renderer before accessing settings
In the master version of frappe, in the first attempt of calling the file manager (when onload is called) the report doesn't build, because in the report view, there is no such attribute list_renderer available.
In that change we check if the list renderer is not undefined and only setup the menu, drag and drop and copy function, when the list_renderer object is available.
This problem might not occur in the developer versions (datatables), but many people still work with the master version and need a working file manager report.
* Update file_list.js
* 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