Commit graph

1759 commits

Author SHA1 Message Date
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
Sagar Vora
5c86dc80c7
fix: if_owner constraint being applied wrongly (#14471)
* fix: `if_owner` constraint being applied wrongly

* test: check if owner on `frappe.get_list`

Co-authored-by: Pruthvi Patel <pruthvipatel145@gmail.com>
2021-10-19 15:03:17 +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
abhishek
ba78852c73 docs: add docstring for import_file_by_path 2021-10-12 17:15:12 +05:30
abhishek
f3d810414a refactor: sync_for() - first install module 2021-10-11 18:59:06 +05:30
abhishek
0be59cee80 chore: add missing document_types 2021-10-11 18:59:06 +05:30
abhishek
69d8eddf5a refactor: remove unused args
refactor: remove unused args
2021-10-11 17:23:17 +05:30
abhishek
278883edb0 fix: missing migration hash column 2021-10-11 17:23:17 +05:30
abhishek
b2b391e90a style: misc 2021-10-11 17:23:17 +05:30
Gavin D'souza
c3be3d35e8 fix: "function"al programming++ 2021-10-11 17:23:17 +05:30
Devin Slauenwhite
2c9f08997a
Merge branch 'frappe:develop' into feat-bulk-rename-merge 2021-10-09 13:10:04 -04:00
Sagar Vora
6b91ade73c
fix: convert_dates_to_str converts everything except date objects (#14340)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2021-10-07 15:58:23 +05:30
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
Suraj Shetty
2f427a82c8 Merge branch 'develop' of https://github.com/frappe/frappe into form-tab-break 2021-09-20 15:49:01 +05:30
Gavin D'souza
09557ab8c7 fix(db_query): Add fallback value irrespective of operator 2021-09-16 15:22:37 +05:30
Suraj Shetty
1cd20c04a7 Merge branch 'develop' of https://github.com/frappe/frappe into form-tab-break 2021-09-16 13:00:07 +05:30
Gavin D'souza
6973a34828 Merge branch 'develop' into compare-columns-db_query 2021-09-16 11:40:33 +05:30
Gavin D'souza
ad5783b1c3 fix: Use PyPika's Column
also, Discard Data class. Since we're adding support for PyPika objects
to natively interact with the Frappe ORM, this PR brings us closer
toward that direction.
2021-09-16 11:38:23 +05:30