Commit graph

1777 commits

Author SHA1 Message Date
Gavin D'souza
4b9d8c0258 fix: Remove extra Document.validate_owner validation 2022-01-04 15:31:08 +05:30
Gavin D'souza
6f2125fca6 Merge branch 'develop' of github.com:frappe/frappe into owner-unchange 2022-01-04 15:06:37 +05:30
shadrak gurupnor
1832df06ad fix: replace owner with allocated_to 2022-01-04 13:39:33 +05:30
shadrak gurupnor
6c6ff2c16d fix: overriding of owner of doc
feat: Fixed the dilemma of owner field in ToDo document
2022-01-04 13:39:16 +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
Lev
0345954b65
perf: BaseDocument improvements (#15398)
* perf: BaseDocument improvements

* Add `default_fields_set`, use default placeholder to lookup fields in update(), refactor get_valid_columns()

* Revert all changes except "update()"

Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
2021-12-31 22:31:40 +05:30
Gavin D'souza
881f3ad8c1 fix: Set owner & creation if new Document
via a323d624eb
2021-12-30 10:35:49 +05:30
Gavin D'souza
62499422a8 style: Make fieldname bold in user message 2021-12-30 10:32:50 +05:30
Gavin D'souza
24830298b0 fix: Make owner, creation fields constant for docs 2021-12-30 10:32:22 +05:30
Suraj Shetty
2d5c5c7f10
fix: Use frappe.permissions.has_permission for proper error message (#15467) 2021-12-28 16:09:42 +05:30
mergify[bot]
b7dfd7f75a
Merge pull request #15443 from alyf-de/dont-rebuild-search
feat: option to not rebuild search on rename
2021-12-27 12:04:19 +00:00
Rucha Mahabal
97d049cab9 fix: set fetch from values before checking permissions
Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2021-12-27 12:56:41 +05:30
barredterra
429d5178e0 feat: option to not rebuild search on rename 2021-12-24 16:14:10 +01:00
Gavin D'souza
0f71dd411b style: DatabaseQuery.execute's permission cond block 2021-12-24 14:01:26 +05:30
Gavin D'souza
33b7d7d74f fix: Handle custom child tables via check_parent_permission
Check `tabCustom Field` and `tabDocfield` for matching parent existence.
2021-12-24 13:28:40 +05:30
Ankush Menat
3101c45f26 fix: return self when using save on new docs
for consistency.
2021-12-20 23:08:00 +05:30
Faris Ansari
2cfebf2a96 fix: set empty lists for unset meta table fields 2021-12-16 20:20:19 +05:30
Faris Ansari
1d67a38059 fix: add doctype_state in sync and install 2021-12-14 16:32:58 +05:30
Faris Ansari
2635da19f4 fix: Add Document States in customize form 2021-12-14 14:20:46 +05:30
Faris Ansari
4db2c1aaa3 feat: Document States
Customize the color of document states. Works with Status field.
2021-12-09 18:30:59 +05:30
Faris Ansari
02759631b4 fix: handle falsy return values in document methods
problem: if a whitelisted document method returns a falsy value like
`[]`, `{}`, `0` then response.message is not set and not returned
in the response.

this change checks if the return value is `None` and falsy values
are returned properly in the response
2021-12-06 15:38:59 +05:30
this-gavagai
8ead1d9c48
fix: Clarified docstatus transition exceptions (#15194)
* [fix] Clarified docstatus transition exceptions

Exceptions issued by the document.py `check_docstatus_transition` method are potentially very misleading. In cases where an invalid docstatus is used, users receive an confusing exception stating "Cannot change docstatus from 0 to 2" or "Cannot change docstatus from 1 to 0". 

This PR adds an additional exception message when an invalid docstatus is used.

* fix: Clarified docstatus transition exceptions

Added additional clarifications to exception messages
2021-12-06 07:28:43 +00:00
Ankush Menat
2f6b57cc0a fix(ux): validate max_attachment on doctype controller 2021-12-01 17:07:37 +05:30
Ankush Menat
124407a70a fix: update EPS records when renaming doc 2021-11-30 11:16:46 +05:30
Ankush Menat
2a08f35836 fix: allow cancelling by PUT docstatus=2 2021-11-29 18:44:10 +05:30
mergify[bot]
00172a6cb5
Merge pull request #15105 from ankush/return_self
fix: return self after submit/cancel
2021-11-28 03:55:24 +00:00
Ankush Menat
88c3d92662 fix: return self after submit/cancel
`Document.save` returns self but `submit` and `cancel` don't.

change:
For sake of consistency and better support for `run_method` via REST API, return the document.

ref: https://github.com/frappe/frappe/issues/14869
2021-11-27 19:34:47 +05:30
mergify[bot]
55103a92e6
Merge pull request #14987 from Aradhya-Tripathi/at/queries
refactor: moving raw queries to frappe ORM
2021-11-26 16:20:04 +00:00
Aradhya
0ea0f7dfa3 fix: fixed default ordering in execute 2021-11-25 16:39:44 +05:30
Aradhya
30278a3939 refactor: removed no_order to support order_by None as valid input 2021-11-23 13:29:59 +05:30
Aradhya
ae59fd7c58 feat: added no_order to execute 2021-11-19 22:58:32 +05:30
Daniel Gerhardt
16dca0b1c1 feat: add consecutive calendar week (WW) for naming series
The calendar week is based on ISO 8601 but behaves slightly different
for the first and last days of a year to ensure consecutiveness:

* If the first days of a year would be in week 53 then 00 is used
  instead.
* if the last days of a year would be in week 01 then 53 is used
  instead.

Closes #14413
2021-11-18 17:52:36 +01:00
mergify[bot]
20e3ed9ff9
revert: "feat(minor): Implement __getitem__ in Base Document" (backport #14945) (#14946)
* Revert "feat(minor): Implement __getitem__ in Base Document (#14855)"

This reverts commit 583a7ef23923d362c85beeabe57703c2d5b12a65.

(cherry picked from commit d165fb3d477e65f7a395118f69278f2cb5c7f4e5)

* fix: keyerror in auto email report

(cherry picked from commit aac20f5d159875a5f3c9b4a6d74beec390e617dd)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2021-11-11 12:13:52 +05:30
Aradhya-Tripathi
5e818198be refactor: converted queries in rename doc 2021-11-09 10:19:54 +05:30
mergify[bot]
b76f79c06c
Merge pull request #14547 from Aradhya-Tripathi/query-conversion
refactor: Converting raw SQL queries using frappe ORM and frappe.qb
2021-11-03 12:06:35 +00:00
Gavin D'souza
e989bfa41d style: Indents & file headers 2021-11-03 16:12:27 +05:30
mergify[bot]
53a2539c5a
feat(minor): Implement __getitem__ in Base Document (#14855) (#14866)
* feat(minor): Implement __getitem__ in Base Document

This addition allows for syntactic sugars like writing doc["name"] to
access document name. This addition is solely for the sake of code
simplicity. Since dictionaries in Python follow this standard, we can
write code that works for both Vanilla Dicts, Frappe Dicts & all
Document objects

* fix: Use getattr over get in getitem

For the sake of consistency and some level of sanity in the universe.

Co-authored-by: Ankush Menat <ankush@frappe.io>

* fix: Raise KeyError instead of AttributeError

why: shit breaks down. Specifically stuff in Jinja templates, attributes
that are conditional. Either this is acceptable or subscripting objects
cannot and probably should not be possible along with our pre-condiitons

* chore: Use hasattr instead of get default

Couldn't decide between a style commit or a chore

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 583a7ef23923d362c85beeabe57703c2d5b12a65)

Co-authored-by: gavin <gavin18d@gmail.com>
2021-11-02 13:24:36 +05:30
Gavin D'souza
ccb53c0f5b fix: If column comparision is done, dont check for ifnull/coalesce 2021-10-29 14:19:28 +05:30
Gavin D'souza
9bf043eddf fix(db_query): Change fallback to min datetime 2021-10-29 13:24:28 +05:30
Gavin D'souza
9be8a0895d Merge branch 'develop' into between-formatting 2021-10-29 13:13:55 +05:30
Suraj Shetty
9189c62437 fix: Pass parent_doctype while checking permission for child_table in db_query 2021-10-27 13:52:34 +05:30
Suraj Shetty
64822df6ff
Merge branch 'develop' into fix-has-permission-for-child-doc 2021-10-27 13:07:44 +05:30
Suraj Shetty
0f98b4d174 fix: Make parent_doctype mandatory while accessing child doctype 2021-10-27 12:59:42 +05:30
Aradhya-Tripathi
cd9e0ffa84 refactor: converted queries in nameing and nestedset 2021-10-26 22:20:03 +05:30
Aradhya-Tripathi
94f2a6e275 feat: Added run kwarg to get_all, get_values 2021-10-23 15:08:02 +05:30
mergify[bot]
c616e557fd
Merge pull request #14358 from dj12djdjs/feat-bulk-rename-merge
feat: bulk rename allow merge option
2021-10-21 08:05:44 +00:00
Mohammad Hasnain
08ac2eda0a Merge branch 'develop' into between-formatting 2021-10-20 19:37:43 +05:30
Mohammad Hasnain
d7b7afeb14 fix: format between for creation/ modified 2021-10-19 16:18:21 +05:30