Commit graph

1954 commits

Author SHA1 Message Date
Ankush Menat
75b7a823a9
Merge pull request #17009 from ankush/delete_doctype_changes
fix!: dont delete customizations when doctypes are deleted
2022-05-30 21:00:50 +05:30
Suraj Shetty
ed72fc5a0e
Merge pull request #17003 from netchampfaris/db-query-child-table-syntax-sugar 2022-05-30 12:21:35 +05:30
Faris Ansari
87ec6d4fb9 fix: initialize link_tables in constructor 2022-05-30 10:50:16 +05:30
Ankush Menat
076eb593e3 refactor: delete_from_table
Whole lot of unnecessary complexity, closure, multiple function calls,
comprehensions all that can be replaced with single `get_all`
2022-05-29 13:46:48 +05:30
Ankush Menat
a0ecb912db fix!: dont delete customizations when doctypes are deleted
If someone deletes doctype and restores it back all customization are
lost, there's no "real" reason to delete all these customization. They
are only ever active if the doctype is being used.

Explanations:

- Custom field: is used by meta when doctype meta is requested, if meta
  isn't requested then custom field is effectively inactive.
- Client script: loaded by meta when doctype is requested by desk. So
  inactive in deleted state.
- Property setter: loaded by meta, so inactive when doctype isn't
  present.
- Report: will break doctype isn't present, but user should delete them
  manually to avoid loss of "scripts" or anything special they might
  have done. Also report's doctype don't 100% indicate that it's based
  solely on that doctype.
2022-05-29 13:46:44 +05:30
Faris Ansari
507a45d8f2 fix: dot syntax support for link fields
 test
2022-05-28 13:57:44 +05:30
Faris Ansari
96b30e714c feat: table_field.fieldname field syntax for db_query 2022-05-27 16:04:22 +05:30
gavin
6dedf899ff
Merge pull request #16899 from ChillarAnand/imports
refactor: Removed unused imports & added flake8 check in CI
2022-05-23 15:53:18 +05:30
chillaranand
1d763a6659 refactor: Fix flake8 issues 2022-05-19 15:34:35 +05:30
gavin
7c77bedbf2 refactor: Simplify logic + Add typing hints 2022-05-18 16:57:54 +05:30
Shariq Ansari
78489cd700
feat: Quick List Block for Workspace (#16887) 2022-05-13 15:34:35 +05:30
phot0n
7ec5e88278 chore: remove unnecessary groups from search regex in cast_name 2022-05-05 21:31:13 +05:30
phot0n
aa6a21fc2c chore: add regex to consider space in cast_name 2022-05-05 21:31:13 +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
Sagar Vora
a33c2e2abe
refactor(BaseDocument)!: improved get, set and extend methods (#16540)
* perf!: 80% faster doc.get for fields with `None` as value

* perf: quicker init child (#3)

* refactor: avoid repitition and improve error message

* test: `doc.extend`

* fix: improve constant naming

* fix: minor improvements and tests

* refactor: improve naming
2022-05-04 18:37:06 +05:30
Ritwik Puri
b41379c78b
fix: misc fixes (integer primary keys) (#16307)
* fix: misc fixes

local.x gets resetted on every request so switched to a simple dict

simplified is_val_used in set_next_val function for sequences

* chore: use multisql for sequence methods

* fix: fields not updating on form

* minor(base_input): removed unnecessary branching in update_input

* chore: remove prints and rename autoincremented_status_map

* chore: added proper type hint + comment + formatting

* fix: added searching in cast_name rather than handling it manually

* fix: share condition query + test_build_match_conditions

* fix: add cast_name to more places

* test: test for sequence

* fix: sequence functions

* fix: inherit frappetestcase

* minor: attach sequence methods to db context local

* chore: update sequence function names in Database

use frappe.db for sequences in naming.py

* fix: convert filename to str (for autoincremented doctypes)

* chore: better regex for modifying values for postgres

* minor: allow changing name column type (if no data is present in the doctype)

* refactor: validate_autoname

converted it to a simple function
enabled changing autoincrement autoname from customize form

* fix: use sql_ddl for change_column_type in postgres

* fix: use not null constraint in postgres when changing name type

* fix(test): updated test_autoincremented_doctype_transition with transitioning when no data is present

* fix(test): updated test_cast_name

probably messed up during rebase

* fix(test): used rollback upon error in transaction for postgres

* chore: use frappe.db.x methods for sequences

* minor: use temporary sequences in test

* minor: use generate_hash for sequence naming in sequence tests

* chore: replace sequence imports with frappe.db.x

* chore: move out casting name fields to a separate method

* refactor: cast_name

more explicit cases for casts and added docstring

* fix: added space in test_cast_name

* chore: fix linter

* chore: better naming for can_change_name_column_type

* chore: add comment for autoincremented_site_status_map

* chore: update/add docstrings
2022-04-29 15:06:03 +05:30
Suraj Shetty
ccc82e2c4c
Merge pull request #15538 from noahjacob/phone_field_control
feat: Phone Control Type
2022-04-28 10:27:52 +05:30
Sagar Vora
224dd319e8
perf(BaseDocument): remove duplicate code (#16733) 2022-04-26 15:52:03 +05:30
gavin
5f2f387a9c
Merge pull request #16130 from gavindsouza/bg-rename_doc
feat: Async Document Renaming
2022-04-26 12:57:31 +05:30
Ankush Menat
fb0cd4c3a9
Merge pull request #16649 from ankush/testing_overhaul
test: better test utils
2022-04-26 12:02:06 +05:30
Sagar Vora
fa7ea4bce8
perf(BaseDocument): ~50% faster as_dict (#16549)
Co-authored-by: Pruthvi Patel <pruthvipatel145@gmail.com>
2022-04-23 09:01:20 +05:30
Ankush Menat
f748ae85fc fix: set docstatus to 0 if None present 2022-04-22 19:47:54 +05:30
Gavin D'souza
c691537e61 chore: Add typing for ease of development 2022-04-21 13:32:13 +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
892e05fdc1 Merge branch 'develop' of github.com:frappe/frappe into bg-rename_doc 2022-04-20 16:04:27 +05:30
Suraj Shetty
8f94cb655f
Merge branch 'develop' into phone_field_control 2022-04-19 16:28:18 +05:30
Rushabh Mehta
6e6fe9521e fix(linting): no single quotes :'| 2022-04-18 17:29:03 +05:30
Rushabh Mehta
fca6c3d305 fix(minor): circular imports? 2022-04-18 17:29:03 +05:30
Rushabh Mehta
57a55e4225 feat(minor): Add document reference to Error Log and doc.log_error 2022-04-18 17:29:03 +05:30
Ankush Menat
b409a7eeba fix: extend autoname validation to child items 2022-04-14 15:16:59 +05:30
Suraj Shetty
6b7fda495b Merge branch 'develop' of https://github.com/frappe/frappe into phone_field_control 2022-04-14 14:19:35 +05:30
Suraj Shetty
48cd1c2ad4 refactor: Fix naming and simpify code
- Ability to clear code, by hiting backspace
2022-04-14 14:14:00 +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
Shridhar Patil
39f8267a15
feat: added support for data type json (#16187)
> Please provide enough information so that others can review your pull request:

Added json support for postgres and mariadb



> Explain the **details** for making this change. What existing problem does the pull request solve?
https://github.com/frappe/frappe/projects/4#card-50160428


> Screenshots/GIFs
![json](https://user-images.githubusercontent.com/11792643/156367383-8f8492c2-3817-449d-a2dd-c983eeadbb48.gif)



---

**Previous attempts:** 

https://github.com/frappe/frappe/pull/8128
https://github.com/frappe/frappe/pull/7096


Docs: https://frappeframework.com/docs/v13/user/en/basics/doctypes/fieldtypes#json
2022-04-14 04:21:41 +00:00
mergify[bot]
5f0a95f8bd
Merge pull request #16449 from resilient-tech/refactor-_dict
refactor!: improved `frappe._dict`
2022-04-14 03:51:55 +00:00
Gavin D'souza
03d542edce fix!: Allow child table naming 2022-04-13 17:32:58 +05:30
Sagar Vora
77879933ce style: make changes as per linter 2022-04-13 13:21:01 +05:30
Sagar Vora
38959637e7
perf: move less expensive condition first
Co-authored-by: gavin <gavin18d@gmail.com>
2022-04-13 11:40:35 +05:30
Sagar Vora
93051389b1 fix: use isinstance instead of looping over __dict__ 2022-04-13 11:20:01 +05:30
Noah Jacob
c2f2fc10e7 Merge branch develop into phone_field_control 2022-04-12 20:40:29 +05:30
Gavin D'souza
20742e396f Merge branch 'develop' of github.com:frappe/frappe into test-nestedset 2022-04-12 18:09:22 +05:30
Gavin D'souza
01e101d4b8 chore: Add typing and and style conflicts 2022-04-12 15:40:37 +05:30
Nabin Hait
b4476e0257 feat: Ignore permlevel for specific fields 2022-04-12 12:24:23 +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
Noah Jacob
2d3c1053a0 refactor(ui): updated validation messages with fieldname 2022-04-11 15:25:27 +05:30
Suraj Shetty
2a994a3be4
Merge branch 'develop' into use-backticks 2022-04-10 07:50:53 +05:30
Noah Jacob
bf92b363e2
Merge branch 'develop' into phone_field_control 2022-04-07 15:04:47 +05:30
Sagar Vora
73fc2f1d59 fix: require key in doc.get 2022-04-04 11:18:46 +05:30
Sagar Vora
e9b1cdcdca refactor(BaseDocument)!: dont return __dict__ if key is falsy 2022-04-04 11:11:13 +05:30
Sagar Vora
aedd2fb2b6
Revert "perf: 80% faster doc.get for fields with None as value" (#16490) 2022-04-01 20:39:27 +05:30