Commit graph

167 commits

Author SHA1 Message Date
Ankush Menat
ce124d8ec2
fix: Skip virtual doctype rename for dynamic links (#25479) 2024-03-15 14:01:40 +00:00
Ankush Menat
b28db475fd
fix: Skip virtual doctypes while renaming (#25473) 2024-03-15 18:56:22 +05:30
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
447f02e8d3
fix!: Remove misleading "raise_exception" (#24266)
frappe.permission.has_permission won't accept raise_exception anymore,
it was extremely misleading argument and actual purpose of the argument
was to print perm check logs.
2024-01-11 08:24:18 +00:00
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
ruthra kumar
94b2e509b9 fix: dont rename link fields in Virtual doctypes 2023-11-20 10:11:42 +05:30
anandbaburajan
ebccab0652 fix: copy any flags if required in rename_doc() only on validate 2023-11-17 00:32:28 +05:30
Ankush Menat
5fd0dfb163 fix: dont allow rename+merge for case changes 2023-08-29 18:03:16 +05:30
Ankush Menat
94e522185d
fix: configurable rename job queue (#21996)
This is useful for doctypes like company where very large number of
documents will be affected on a large DB.

original change:

fix: move rename enqueue action to long queue

When trying to rename company the job constantly fails.

possibly alternate fix to https://github.com/frappe/frappe/pull/21995

Job timed out because of 300 seconds timeout, no amount of optimization
will fix this because it's rewriting practically every row in
transactions.
2023-08-10 10:02:16 +05:30
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