Commit graph

155 commits

Author SHA1 Message Date
gavin
05893bef42
fix: Rename document/update title via toolbar (update_document_title API) (#21404)
* fix: update_document_title

* Fix broken socket event
* Fix broken title + name doc update

* fix: if only title updated then dont enqueue

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-06-21 15:46:09 +05:30
Ankush Menat
3005e66e45 refactor!: Drop previously deprecated code 2023-06-13 16:00:43 +05:30
Ankush Menat
45c86e2ff8
fix: nestedset rename (#20498) 2023-03-29 12:49:28 +05:30
Ankush Menat
07529ff1c3
fix: Consider parenttype when renaming (#19901) 2023-02-02 17:05:44 +05:30
Saqib Ansari
f6677125d3
fix: do not rename select field options and values on doctype rename (#19223) 2022-12-09 16:36:58 +05:30
Saqib Ansari
6997f9e90f
fix: do not rename fieldtype options (#18143) 2022-09-15 17:30:52 +05:30
Sagar Vora
63e760e3ad chore: remove old code where User Permissions were set in tabDefaultValue 2022-08-22 19:03:30 +05:30
Ankush Menat
2eec621e95 chore: db.get_all -> get_all
Reduces 1 pointless function call.
Function calls are also not "super cheap" in python.
2022-08-22 11:35:14 +05:30
Gavin D'souza
71b5c77e6e Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-07-05 14:55:02 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
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
2022-07-01 11:51:05 +05:30
Gavin D'souza
25b87a9d49 chore: NoneType alias for < PY310 2022-06-16 15:04:35 +05:30
Ankush Menat
c31eca3ba5
fix: circular imports (#16830)
Circular imports issue when loading modules in background worker. Doesn't happen in web worker or console 🤷
2022-05-04 19:09:53 +05:30
Gavin D'souza
6cdd33f26b fix: Generate hash of length 8 for save point 2022-04-20 16:41:25 +05:30
Gavin D'souza
66655eb8ed Merge branch 'develop' of github.com:frappe/frappe into bg-rename_doc 2022-04-14 13:41:56 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Gavin D'souza
28f9802fd9 fix: rollback to savepoint to avoid partial commits
It's better to keep the validations in and out AND separate...this is a
humble attempt for the same :)
2022-03-28 18:47:26 +05:30
Gavin D'souza
f92f77dab7 fix(qb): Make Table importable 2022-03-22 20:31:37 +05:30
Gavin D'souza
3351cc9c80 refactor(rename_doc): Use QB notation inplace of raw SQLs
* Converted ~22 queries from raw SQL to use frappe.qb notation
* Made queries DRY-er
2022-03-22 20:31:10 +05:30
Gavin D'souza
1cb956d835 fix(rename_doc): Use sbool instead of cint
cint("false") returns True which is what is sent by frappe dialog. This
may be required to be fixed in the client alone but making this change
to make the API more "robust" as this has been working in this
particular way for far too long now :')
2022-03-22 17:33:51 +05:30
Gavin D'souza
0e87013421 chore: Add docstring for rename_doc 2022-03-22 16:12:36 +05:30
Gavin D'souza
e2489f8377 fix: Validate title updates via update_document_title API 2022-03-22 14:55:10 +05:30
Gavin D'souza
d92a64e767 fix: validate before enqueuing rename_doc
* refactor validate_rename
* don't run before_rename hooks twice
* validate_rename kwarg in doc.rename
2022-03-22 14:53:22 +05:30
Gavin D'souza
448fb8a207 Merge branch 'develop' of github.com:frappe/frappe into bg-rename_doc 2022-03-22 12:29:43 +05:30
Gavin D'souza
e8ec8410e6 fix(rename_doc): Allow updating only document title or name 2022-03-09 12:57:27 +05:30
gavin
35c18291ec
Merge branch 'develop' into bg-rename_doc 2022-03-04 01:01:36 +05:30
gavin
501a1675ec
chore(rename_doc): Consistent error message for no change 2022-03-01 22:31:17 +05:30
Gavin D'souza
81a3058808 fix: enqueue option for update_document_title API
Pass enqueue=True to enqueue rename document operation. Desk will be
using this from now on ;)
2022-03-01 13:22:46 +05:30
Gavin D'souza
2b3d9cbcd8 feat: Rename Document via Background Job 2022-02-28 19:46:58 +05:30
Gavin D'souza
429162ba31 fix: Use rename doc method wrapper 2022-02-28 18:05:36 +05:30
Devin Slauenwhite
7dc5c358da fix: log failed rename record. 2022-02-24 16:50:10 -05:00
Gavin D'souza
0b418d2728 perf: Pass document through rename_doc API to bypass extra get_doc 2022-02-25 01:08:31 +05:30
Gavin D'souza
783a63f8a2 fix: Raise PermissionError if user doesnt have access to document 2022-02-24 17:28:39 +05:30
Gavin D'souza
f8b52d8e4f Merge branch 'develop' of github.com:frappe/frappe into update-title-types 2022-02-24 11:56:00 +05:30
Gavin D'souza
c4c3d26b3d fix!: Disallow posiitonal args in update_document_title 2022-02-23 18:22:42 +05:30
Gavin D'souza
91da5f0363 refactor(rename_doc): update_document_title API
* Remove redundant API arguments
* Check for permission on specified document
* Maintain backwards compatibility - test_update_document_title_api
  checks for this
* Update desk client usage ;)
2022-02-23 17:21:59 +05:30
barredterra
745297a49d refactor: a not in b
Search: if not ([\w\d]*?) in ([\w\d]*?)
Replace: if $1 not in $2
2022-02-21 19:54:34 +01:00
Gavin D'souza
8aedf6410a fix: None is not NoneType
* also, rename test ;)
2022-02-18 20:19:51 +05:30
Gavin D'souza
953560af35 chore: Add type hints for rename_doc module
* Easier debugging ffs :crie:
2022-02-18 17:56:42 +05:30
Gavin D'souza
a307767dd5 refactor(minor): update_document_title API
* Check for acceptable types
* Check for DocType permission
* Raise all exceptions if occured during document renaming
2022-02-18 17:16:35 +05:30
gavin
d78b496208
fix(Custom DocPerm): Use Link type instead of Data for parent (#15715)
* fix: Use Link type instead of Data for parent

This makes sure frappe.rename_doc updates linked doctype records

* Revert "fix: Use Link type instead of Data for parent"

This reverts commit 93b37351069df9a79f04bfa326378f09bf97700f.

* fix(rename_doc): Handle re-linking Custom DocPerm records
2022-01-25 11:14:34 +00:00
Gavin D'souza
6f2125fca6 Merge branch 'develop' of github.com:frappe/frappe into owner-unchange 2022-01-04 15:06:37 +05:30
Gavin D'souza
f72c445d41 fix: Clear Document cache on rename, delete 2022-01-03 19:02:41 +05:30
mergify[bot]
a52cd373af
Merge pull request #15508 from nextchamp-saqib/fix-modified-on-rename
fix: renaming a document updates the modified timestamp
2022-01-03 13:11:47 +00:00
Saqib Ansari
b0b19d7a09 fix: renaming a document updates the modified timestamp 2022-01-03 18:25:12 +05:30
barredterra
429d5178e0 feat: option to not rebuild search on rename 2021-12-24 16:14:10 +01:00
Ankush Menat
124407a70a fix: update EPS records when renaming doc 2021-11-30 11:16:46 +05:30
Aradhya-Tripathi
5e818198be refactor: converted queries in rename doc 2021-11-09 10:19:54 +05:30
Devin Slauenwhite
12e4b33a1f
fix: simplify merge condition statement
Co-authored-by: gavin <gavin18d@gmail.com>
2021-10-13 11:26:24 -04:00
Devin Slauenwhite
d61d4214cf Merge branch 'develop' into feat-bulk-rename-merge 2021-10-04 14:19:41 -04:00
Devin Slauenwhite
a8347c0b27 feat: allow bulk rename with merge 2021-10-04 14:15:54 -04:00