Commit graph

958 commits

Author SHA1 Message Date
Rushabh Mehta
dd189d4c99 [fix] set default naming_series in naming.py if not set 2018-06-06 12:00:27 +05:30
Rushabh Mehta
c32bcca4e8 [fix] set default naming_series in naming.py if not set 2018-06-06 11:24:20 +05:30
Nabin Hait
786db7de12 minor fix 2018-06-04 12:26:53 +05:30
Nabin Hait
6e00608556 import sync_user_settings in rename_field 2018-06-04 12:24:58 +05:30
Manas Solanki
a91da5f706 Update user settings (#5634)
* update the user settings on the rename of any records.

* also update the renamed fields in the user settings

* fix codacy
2018-06-04 11:53:03 +05:30
Saurabh
55eaba90f5 [fix] Sanitize blacklisted functions 2018-05-30 15:25:40 +05:30
Nabin Hait
418d654331
Fixed sanitizing fields for tabDeleted Documents (#5329) 2018-05-30 15:01:12 +05:30
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
Manas Solanki
5ea4fb6157
Update db_schema.py (#5622) 2018-05-28 16:02:32 +05:30
Saurabh
56bf3bf40b [fix] resolved merge conflicts 2018-05-28 11:43:38 +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
6a4a246ad7 Fetch From also applicable for Check fields (#5611) 2018-05-25 10:46:43 +05:30
Nabin Hait
8d8c49f43b fetch_from fixes in mapper 2018-05-25 09:55:58 +05:30
Zarrar
076e1d5be0 run docfield patch prior to other patches (#5594) 2018-05-23 13:16:53 +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
tarokobear
e85e52a591 Account for documents with integer names so they can be deleted. (#5567) 2018-05-22 11:23:59 +05:30
Nabin Hait
6737f1912c Fixed merge conflict 2018-05-08 15:27:37 +05:30
Ameya Shenoy
439effed7d Rebuild help for docs which have been renamed (#5521)
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
2018-05-06 11:59:00 +05:30
Nabin Hait
3bb36344a6 minor fix 2018-05-05 12:07:54 +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
8923cb6aa9 Validate fieldnames that contain space (#5499) 2018-04-30 11:27:44 +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
Saurabh
56b6167c1f [fix] merge conflicts 2018-04-19 11:16:28 +05:30
Saurabh
3d7e56d1ef [fix] added ignore_in_install flag to accommodate Gcal custom field (#5455) 2018-04-18 12:39:56 +05:30
Suraj Shetty
cb627cc7d6 workflow fix (#5452)
* workflow fix

* add a line
2018-04-17 01:23:49 -08:00
Nabin Hait
5c824c1ee0
Revert "[Minor][Bug Fix] permission in workflow docs (#5449)" (#5453)
This reverts commit 4d4c4e55fd.
2018-04-17 12:50:10 +05:30
KanchanChauhan
4d4c4e55fd [Minor][Bug Fix] permission in workflow docs (#5449) 2018-04-17 11:59:38 +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
fc7de01017 Raise exception while deleting an item which is a product bundle (#5286)
* raise exception while deleting an item which is a product bundle

* separated if statements and added a comment

* modified condition
2018-04-16 01:26:19 -08:00
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
Saurabh
b5f4959f74 check track changes attribute with getattr (#5435) 2018-04-12 11:14:14 +05:30
Saurabh
f395e31e30 check track changes attribute with getattr (#5435) 2018-04-11 02:25:56 -08:00
Rushabh Mehta
c4e1b9e0c1
[enhance] Add condition in transitions and move workflow to server-side (#5399)
* [workflow] move to server side

* [workflow] tests

* [workflow] tests

* [minor] remove print

* [fixes] tests and lint

* [tests] fix typo

* [fix] tests
2018-04-11 00:38:13 -08:00
Suraj Shetty
fb25fdb609 Auto email report fixes (#5410)
* fixes https://github.com/frappe/erpnext/issues/13319

* fixes https://github.com/frappe/erpnext/issues/13422

* change auto email report template

* change auto email report template

* Update data.py

* Update data.py
2018-04-10 10:53:05 +05:30
Nabin Hait
9fea757559 Merge branch 'master' into develop 2018-04-09 19:16:01 +05:30
Nabin Hait
665d203146 Save versions only if track changes enabled 2018-04-09 19:06:09 +05:30
Rushabh Mehta
5a582564e3 [fix] add data integration to sync sequence 2018-04-06 13:20:11 +05:30
Nabin Hait
82f1058ad4 Merge branch 'master' into develop 2018-04-04 11:23:21 +05:30
Suraj Shetty
0be4342649 User permissions redux (#5314)
* [start] removing simpler user permission structure

* permission changes
removed "apply user permission" from has_permission

* test fixes and other supporting fixes

* Removed Apply user permission code

* additional check to see if user has some user permissions related to a doctype

* test fixes

* removed a test

* Permission changes
- Code to restrict access if module is blocked for user.
- [Fix] ignore user perm if applicable

* List view restrictions ui changes

* removed unwanted apply user perm code

* permission (block module fix)

* permission fix

* change user permission
user permission will not be applied if user doesn't have role permission

* removed left "apply_user_permissions" property

* add user permission help template

* perm js refactor

* ui / ux changes
restrict list view before entering view if user is not permitterd
add description for if owner check in role permission manager

* codacy fixes

* permission code fix
add controller permission check
add blocked module check in build_permission

* optimized get blocked module method
2018-04-03 10:42:04 +05:30
Achilles Rasquinha
496a63f07f fix _cast_result 2018-04-02 14:23:20 +05:30
Shreya Shah
e2732751a2 able to pass filters (#5323) 2018-04-02 10:43:04 +05:30
Achilles Rasquinha
0fc518ace4 python 3 fixes 2018-03-31 18:15:43 +05:30
Achilles Rasquinha
b4be0a79c1 fix timestamp mismatch for all singles 2018-03-31 17:34:36 +05:30
Achilles Rasquinha
6598be192f cast for standard fieldnames 2018-03-31 14:57:42 +05:30
Achilles Rasquinha
6340b5c4bf val to value 2018-03-29 10:36:41 +05:30
Achilles Rasquinha
05ad109bcb cast singles fieldtype 2018-03-29 09:56:44 +05:30