Commit graph

1740 commits

Author SHA1 Message Date
tundebabzy
2efcea9bbd DocType Naming With Multiple Fields (#5497)
* Update README.md

* refactor for better readability

adds ability to name by concatenating fields

add comments

PEP 8 fixes

throw error when field option autoname fails

adds concatenation option description to DocType doctype

* codacy

* remove explicit cast to `str`

* more pep8 fixes

* revert incorrect link

* code review - move internal functions to bottom of module
2018-05-30 11:37:49 +05:30
Suraj Shetty
c71c132ba2 Workflow actions (#5598)
* Init workflow actions

- WIP code
- Add hooks to create and update
workflow action on document status changes.
- Tweak listview to show host document on list view item click
- Add new doctype "Pending Workflow Action"
- Add allow_self_approval check in Workflow master

* Rename doctypes

- Rename "Workflow Action" to "Workflow Action Master"
- Rename "Pending Workflow Action" to "Workflow Action"
- Remove irrelevant files

* Clear old workflow action on docstatus change

- Add check for user permission before creating a workflow action record
- Make doctype changes to support the Workflow Action  System

* Show host document only if workflow action status is open

* Send workflow action mail notifications

* Add patch to rename `tabWorkflow Action` to `tab Workflow Master`

- Rename table to retain data in `tabWorkflow Action` as it
will be overwritten with new structure on migration

* Enqueue email

* Remove unused files

* Add hook for custom has_permission

* Optimize send_workflow_action_email method

* Add permission_query_condition hook

* Show notification based on status

* Override get_form_link in list view

* Refactor workflow action

- Add action link
- update workflow action hooks

* Avoid repeated creation of Worklow Actions

- Update hooks entry to avoid unwanted method call

* Fix error with frappe.db.count usage

* Fix ui/ux for Workflow Action

- Fix action url and improve response on action button click
- Fix workflow action template style

* Fix Codacy

* Add self approval check

* Fix codacy

* Fix test

* Fix python version confilct and a permission error

* Fix incorrect 'this' reference

* Update with requested changes

* Add next action email template option

* Fix string formatting

* Refactor workflow Action

- Make process_workflow_action smaller

* Fix bugs and errors due to refactor

* Fix workflow field caching

* Add a workflow action test

* Fix bugs with email template
2018-05-30 11:24:49 +05:30
Nabin Hait
c49193c1c1
Fetch from property is now applicable for all fieldtypes except no_value_fields (#5624)
* Reload docperm

* Reload docperm

* Fetch from property is now applicable for all fieldtypes except no_value_fields
2018-05-29 10:54:45 +05:30
Saurabh
56bf3bf40b [fix] resolved merge conflicts 2018-05-28 11:43:38 +05:30
Rushabh Mehta
5e09a3a9b8 [minor] strip special characters when making a fieldname 2018-05-25 15:48:00 +05:30
schilgod
bcaabe5163 Enhancement to allow User to login from any IP if two factor auth is enabled (#5209)
* Enhancement to allow login from any IP if two factor auth is enabled

* Resolve Conflicts

* optimize code
2018-05-25 10:50:24 +05:30
Manas Solanki
78c839eb5f handle Int overflow (#5607)
* handle the int overflow

 - convert the int to the bigint if the length is more than 11

* proper formatting
2018-05-25 10:47:44 +05:30
Nabin Hait
24a4972413 fetch_from fixes 2018-05-25 09:49:38 +05:30
Ameya Shenoy
949ec96fbc
Merge branch 'master' into develop 2018-05-24 08:43:19 +00:00
Ameya Shenoy
4f4a169526 Prevents circular linking of docs (#5589)
* Prevents circular linking of docs

- also added test case to check if code to prevent circular linking of
doctypes works

* created a CircularLinkingError class

- this can be used later if circular linking error needs to be thrown
elsewhere
2018-05-24 12:07:02 +05:30
Rushabh Mehta
f39c286409 [fix] calendar render for empty list, user_list.js 2018-05-23 17:06:42 +05:30
Nabin Hait
dcea529454
Update activity_log.json 2018-05-23 13:40:15 +05:30
Zarrar
e76b3eef4e [Enhance] New DocField - 'Fetch From' (#5563)
* add new docfield fetch_from - serves as add_fetch

* replace options.split with fetch_from.split

* copied data from options to fetch_from

* patch to update fetch_from for docfield, custom_field and property_setter

* update tests according to fetch_from change
2018-05-23 11:07:57 +05:30
Ameya Shenoy
06851e7376
Merge branch 'master' into develop 2018-05-22 08:45:40 +00:00
Stavros Anastasiadis
9607b336a4 Select fields to allow in quick entry (#5461) 2018-05-22 11:49:32 +05:30
ci2014
0a9192d791 Use email instead of user name for building exclude list from thread_notify (#5502)
* Update email.py

* Get the correct Email Address for Administrator

Get the correct Email Address for the Administrator User as well. I see no reason why.
2018-05-22 11:44:34 +05:30
Saurabh
7798dfc0d3 [fix] handle worker timeout issue while taking backup to dropbox (#5450) 2018-05-22 11:43:06 +05:30
Rushabh Mehta
1fc8cec2c6
[minor] removed duplicate notify_by_email 2018-05-21 12:27:54 +05:30
Suraj Shetty
8f386d709f Allow everything for Admin (#5561)
- Return every available roles if the user is admin
This will allow admin to access doctype even if doctype
has docperm with only disabled roles
- No more need to add roles for admin on every new role creation
2018-05-17 12:33:38 +05:30
Rushabh Mehta
b4650f42a1 [minor] remove in_dialog old property 2018-05-16 12:51:01 +05:30
Suraj Shetty
92e4db1dd9 Fix a bug with whitelisted method (#5551)
- Add additional check to avoid wrong user set
2018-05-16 11:11:37 +05:30
Zarrar
b2873be5fb [Fix] Email and Contact fixes (#5519)
* 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
2018-05-14 19:21:35 +05:30
Nabin Hait
6737f1912c Fixed merge conflict 2018-05-08 15:27:37 +05:30
Nabin Hait
09cbf49ff1
Increase the length of Singles table columns (#5540) 2018-05-08 15:12:00 +05:30
Suraj Shetty
a93bc87363 Permission fixes (#5530)
* Add User Permissions to Config module

* Update Permission Manager help

* Fix share button

* Remove user-permissions page

* Remove unnecessary error modals

* User Permission UI fixes
- Fix double multicheck bug on save
- Add margin above and below select all button

* Update user_permissions dict realtime on client side

- Remove user_permissions from boot

* Cast permission dict values to int
2018-05-04 19:49:11 +05:30
ci2014
8b2e4a5f4c Check for list_renderer before accessing settings (#5469)
* 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
2018-05-04 13:15:30 +05:30
Suraj Shetty
3109123249 Permission improvements (#5494)
* 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
2018-05-04 13:13:29 +05:30
Saurabh
f3a25b3f91 Merge branch 'master' into develop 2018-05-02 14:51:46 +05:30
Faris Ansari
1ccf9d85b8
get_emails_from_role should only pickup enabled users (#5504) 2018-05-02 11:02:07 +05:30
Zarrar
efa359e201 restore original permissions for standard and custom doctypes (#5498) 2018-04-30 11:29:05 +05:30
Saurabh
1e00ef289e Merge branch 'master' into develop 2018-04-25 11:35:48 +05:30
Suraj Shetty
95c02f94ef Nested permission (#5460)
* nested permission

* test for nested permission

* [minor] Format code

* Fix nested permission test

* Fix codacy
2018-04-20 18:07:55 +05:30
Rah Yuliantoro
d6902b5010 Update permission_manager_help.html (#5462)
translation tag
2018-04-20 12:26:15 +05:30
Manas Solanki
a79513fc2a Fix autoname in data_import.py (#5474) 2018-04-20 11:41:59 +05:30
Saurabh
56b6167c1f [fix] merge conflicts 2018-04-19 11:16:28 +05:30
Suraj Shetty
14c621fca2 Success Action (#5434)
* success model init

* ui changes

* whitelisted get_count method

* refactor success action

* refactor form.js
- lint error fixes
- reject promise on error

* Refactor
- option to add body to msg-alert
- remove unwanted css
- tweak msg-alert ui

* remove alert on any action click

* sample success modal config for toDo

* success alert redesign

* docstatus check

* close button position fix

* add doctype for success action setting

* remove unwanted changes

* remove unused import

* rename success action setting to success action

* add translatable label

* rename for_doctype to ref_doctpe

* remove unused frappe import

* replace get_list with get_all
to ignore permission check while loading boot
2018-04-18 11:22:51 +05:30
Nabin Hait
de63fa5737
Sync optimization related to varchar length and index on version table (#5437)
* Sync optimization related to varchar length and index on version table

* Minor fix
2018-04-17 11:58:01 +05:30
Shreya Shah
64fe2749cb avoid link validation error in authentication (#5415) 2018-04-16 01:25:34 -08:00
Rushabh Mehta
74046de5dd [minor] 2018-04-16 10:57:33 +05:30
Manas Solanki
68377501fc increase the field limit for the csv file (#5438) 2018-04-15 21:15:02 -08:00
Prateeksha Singh
286131b422
Merge pull request #5443 from pratu16x7/hub-fixes
[fix] desk svg icons
2018-04-13 17:06:22 +05:30
Prateeksha Singh
b72b208afa [fix] desk svg icons 2018-04-13 17:05:10 +05:30
Saurabh
7971a79f3b syntax fix in doctype.py (#5413) 2018-04-09 18:26:35 +05:30
Nabin Hait
116ac139cf Merge branch 'master' into develop 2018-04-09 15:21:30 +05:30
rohitwaghchaure
75ec77193e Removed administrator from the email list of cc, bcc (#5416) 2018-04-09 12:43:11 +05:30
Prateeksha Singh
9bda662ae7 [fix] app-icon-svg 2018-04-09 10:58:56 +05:30
Nabin Hait
ef536e055b Merge branch 'master' into develop 2018-04-07 19:57:04 +05:30
rohitwaghchaure
4c032eabbe Removed owner of the document from the BCC (#5401) 2018-04-07 19:55:45 +05:30
Nabin Hait
944b45b62d fixed merge conflict 2018-04-06 15:05:15 +05:30
rohitwaghchaure
0b251f44fb [Fix] Owner of the document not getting the notifications for transactions they follow (#5396) 2018-04-06 14:54:29 +05:30