Commit graph

5850 commits

Author SHA1 Message Date
Maharshi Patel
d9a8b7ee78 chore: rename __temporary_name & check temp_doc_name
* renamed file_relink_temp_docname to __temporary_name
* added check for temp_doc_name in relink_files in case someone
    calls the function it directly
2023-10-13 10:20:03 +05:30
Maharshi Patel
e888e49cc2
fix: don't update unnecessary fields
removed attached_to_doctype and attached_to_field from set_value as those are not required.

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-10-12 08:42:42 +05:30
Shariq Ansari
0c4021a1a5
Merge pull request #22701 from shariquerik/permission-table-getting-empty 2023-10-11 15:33:12 +05:30
Shariq Ansari
f8c090ffa8 fix: load doctype model instead of using frappe.model.with_doctype 2023-10-11 15:01:26 +05:30
Maharshi Patel
53cdd6d1bf fix: relink attachments before saving doc
Certain people add attachment, before filling mandatory fields
which will raise Missing Fields error.

Or any other kind of errors raised by different validators due to which
file is uploaded but doc is not saved.

This will lead to orphaned/mislinked files. ex. new-purchase-receipt-1

This fix changes name of new docs to new-<doctype>-<no>-<10digithash>
after saving the document we can use this new name to find any mislinked
files created in past hour and relink them to the new doc on save.
2023-10-10 23:49:16 +05:30
Gursheen Kaur Anand
9f11e399e4
Merge branch 'develop' into audit-trail-filters 2023-10-10 15:44:05 +05:30
Gursheen Anand
3c4fa8415e fix: set date fields in test 2023-10-10 15:33:13 +05:30
Gursheen Anand
22e138de9e fix: filter docs in controller 2023-10-10 15:32:03 +05:30
Gursheen Anand
796c2608b3 fix: validate date fields explicitly 2023-10-10 15:25:02 +05:30
Gursheen Anand
56d1bf2732 fix: filter document field using date 2023-10-10 15:21:43 +05:30
Gursheen Anand
8707fbf248 fix: make date filters mandatory 2023-10-10 15:21:04 +05:30
Gursheen Anand
6758be3e24 feat: start and end date filters 2023-10-10 13:05:18 +05:30
Gursheen Anand
53712ed556 fix: only show amended docs in dropdown 2023-10-10 13:02:05 +05:30
Gursheen Anand
c5321f12f2 fix: allow write perm by default 2023-10-04 12:51:41 +05:30
Ankush Menat
8242d75bc6 fix: no perm if doc doesn't exist
Right now "doc doesn't exist is thrown, instead we can assume that user
doesn't have permission to this file. User might have access to other
file still.
2023-09-29 13:11:02 +05:30
Ankush Menat
235ae23c3a refactor: Use newline as separator instead of comma 2023-09-25 16:49:26 +05:30
Ankush Menat
68bf9f50c4 fix: Global allowlist for file extensions
This is dumb validation to have and it barely improves security, but
eNterPriSe users keep demanding this nonsense hence we are forced to add
this.

Alternate to https://github.com/frappe/frappe/pull/22528
2023-09-25 16:45:58 +05:30
Ankush Menat
59d1eefa61 refactor: move unhandled email to log settings 2023-09-23 11:23:53 +05:30
Corentin Flr
d73a854191
feat(UX): Add autocomplete for User timezone (#22456)
* feat(UX): Add autocomplete for User timezone

* Revert "feat(UX): Add autocomplete for User timezone"

This reverts commit a721b4a1ef8e0e6b656b6795b832324a955b2f7a.

* fix: convert tz to autocomplete

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-18 22:37:32 +05:30
Ankush Menat
0381f836d6 fix: update correct role permission rule
Right now if you have if-owner rule on doctype then whatever you change
will only apply to last inserted rule because we don't check if-owner
value

Long term better fix: Identify with perm rule name instead of arbitrary
"primary keys" defined in code.
2023-09-18 13:45:20 +05:30
Ankush Menat
b484c65283 fix: check if owner while deleting permission
If doctype has 2 rules: 1 with if-owner and one without then deleting one deletes both.
2023-09-18 12:33:26 +05:30
Ankush Menat
662b07170c test: orpahned doctype check after patch test 2023-09-15 16:18:25 +05:30
Ankush Menat
b9ee6827b4 refactor: stale object removal
- Do it after migration, post migration might use some old doctype.
- stale -> orpahn
- dont commit changes individually
- Remove table doctype too
2023-09-15 16:18:25 +05:30
HENRY Florian
cf63690a3c
feat: use Link field for search in Role Permissions Manager (#22232)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-09-15 15:13:02 +05:30
Ankush Menat
530c47ffe5
feat: after_response callback manager (#22398)
* feat: `after_response` callback manager

* perf: defer closing DB connection

* refactor: simplify after response hooks

* wip

* example usage

---------

Co-authored-by: Sagar Vora <sagar@resilient.tech>

* fix: Log request end if not already

---------

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2023-09-14 10:56:08 +00:00
google-boy
9d8c6012a2
fix: Check if user has no associated email accounts. (#22355)
check that the return array does not exist, is not an array, or is empty 

http://stackoverflow.com/questions/24403732/ddg#24403771
2023-09-13 14:40:29 +05:30
Ankush Menat
970a740164
revert: #22308 (#22389)
* Revert "chore: move function to correct file"

This reverts commit ebfdfa283b.

* Revert "refactor!: merge get_site_url into get_url (#22308)"

This reverts commit 2001bc278f.
2023-09-13 14:34:52 +05:30
Alfredo Altamirano
39c06cffcd
fix: pass console to import file (#22385)
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-13 14:28:52 +05:30
Deepesh Garg
b3742b45a8
Merge pull request #22104 from GursheenK/doc-comparator
feat: audit trail
2023-09-13 14:04:15 +05:30
Ankush Menat
c55dcc439e
feat: max_file_size configurable from system settings (#22384)
also increase default max_file_size from 10MB to 25MB
2023-09-13 13:33:36 +05:30
Gursheen Anand
aa18c4f751 fix: rename imports 2023-09-12 13:56:23 +05:30
Gursheen Anand
99df38a264 refactor: avoid fetch for amended field again 2023-09-12 12:57:33 +05:30
Gursheen Anand
bda868b0c2 fix: rename doctype 2023-09-12 12:56:48 +05:30
David Arnold
2001bc278f
refactor!: merge get_site_url into get_url (#22308)
* chore: merge get_site_url into get_url

* fix: keep alias with deprecation notice
2023-09-11 15:09:05 +05:30
Gursheen Anand
a7a6f438be fix: use latest doc name for test 2023-09-11 11:49:40 +05:30
Gursheen Anand
4add076285 refactor: use old value instead of fetching parent doc 2023-09-11 11:15:24 +05:30
Gursheen Anand
0b722906db fix: fetch prev docs from last amended doc 2023-09-11 11:10:06 +05:30
Gursheen Anand
177955a12f fix: check label for fields 2023-09-11 11:06:01 +05:30
Bernd Oliver Sünderhauf
2efdead485
fix: Defer module deletion IO post DB commit (#22336)
* fix: Defer module deletion IO post DB commit

Previously, the IO operations for module deletion were executed before the DB commit. If the latter failed, this caused significant inconsistencies. This change ensures that IO operations are deferred until after the DB transaction is successfully committed.

* refactor: module deletion

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-10 13:00:50 +05:30
Ankush Menat
cbc5f0b8db
build(deps): update python dependencies (#22294)
* build!: Remove pycryptodome dependencies

This is added for payments app, shouldn't be added here.

ref: https://github.com/frappe/frappe/pull/9955/

* build(deps): update many python dependencies
2023-09-02 12:10:13 +00:00
Ankush Menat
c22f128475 chore: disable perf tests on postgres 2023-09-02 16:07:08 +05:30
Sabu Siyad
7f88f819ef
feat: communication: override on_update (#22267)
* feat: communication: override `on_update`

If reference doc has a property, `on_communication_update`, execute it.
Otherwise, continue with default/magic actions

* fix: make sure method is callable

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-02 16:01:38 +05:30
Raffael Meyer
a5c176e5f5
feat: show warning headline in public files (#22242) 2023-09-02 15:53:01 +05:30
Raffael Meyer
744b383e9a
fix: don't attach web view link if disabled (#22276)
* fix: don't attach web view link if disabled

* feat: improve label

old: "Send document Web View link in email"
new: "Include Web View Link in Email"
2023-09-02 11:43:28 +05:30
RitvikSardana
6fc2cc7fa3
fix: when tree doctype is created ignore_user_permissions is set to 1 by default (#22235) 2023-09-01 14:29:50 +05:30
Ankush Menat
9436c14265 chore: treat background submit as beta feature 2023-08-31 11:59:40 +05:30
Ankush Menat
e88cdb6e70
Merge pull request #22224 from ankush/desk_user
feat: `Desk User` role
2023-08-29 20:27:21 +05:30
Ankush Menat
92d11d9f1f fix: revert communication doctype default
This breaks for users who dont have "inbox" which is a lot of users.
2023-08-29 17:21:18 +05:30
Ankush Menat
dc8d7b019a refactor!: Lower roles from All To Desk User 2023-08-29 12:07:57 +05:30
Ankush Menat
1b406edd54 feat: Desk User role 2023-08-28 22:31:23 +05:30