Commit graph

1818 commits

Author SHA1 Message Date
mergify[bot]
1df33cbfcf
Merge pull request #15975 from resilient-tech/fix-limit-without-filter
fix: limit without filter
2022-02-15 13:40:56 +00:00
mergify[bot]
4b27569d13
Merge pull request #15962 from resilient-tech/ignore-doctype-in-setter
fix: Ignore `doctype` in setter
2022-02-15 09:31:20 +00:00
Pruthvi Patel
7ce9f1eaa1 fix: limit without filter 2022-02-15 13:06:55 +05:30
Sagar Vora
8a264d05ca fix: remove ignore_in_getter; cleaner implementation 2022-02-15 13:02:52 +05:30
Gavin D'souza
57c7f63d44 fix: Add ignore_virtual option to get_valid_dict
Allows to create new Documents with virtual docfields
2022-02-14 20:26:56 +05:30
Ankush Menat
c38d1f8a25
Merge pull request #15906 from ankush/ignore_duplicates_db
feat(db/pg): ability to ignore pk collision
2022-02-14 18:58:07 +05:30
Pruthvi Patel
882c68671d fix: ignore doctype in setter 2022-02-14 12:22:40 +05:30
mergify[bot]
04bf47f117
Merge pull request #14593 from gavindsouza/dynamic-docfields
feat: Virtual DocFields
2022-02-14 05:31:35 +00:00
Ankush Menat
d3f768fef9 feat(db/pg): ability to ignore pk colission 2022-02-09 16:25:36 +05:30
Rucha Mahabal
78e606bd0f
Merge branch 'develop' into fix-naming-validation 2022-02-09 10:52:24 +05:30
Gavin D'souza
0482f1362a Merge branch 'develop' of github.com:frappe/frappe into dynamic-docfields 2022-02-08 16:50:58 +05:30
Ankush Menat
c5fbd07840
revert: "fix: use now instead of is_async in tests (#15893)" (#15899)
This reverts commit 1cd4722235.
2022-02-07 19:10:42 +05:30
phot0n
7bd84496c1 fix: use int for docstatus in get_default_df 2022-02-07 16:43:16 +05:30
phot0n
266e1f95ed chore: adding back idx column
This is needed for ordering in display of links as it keeps
track of the clicks on a particular link item
2022-02-07 16:40:01 +05:30
phot0n
b31f3c24f6 refactor: remove parent, parenttype, parentfield, idx columns from non-child table doctypes
* feat: add parent, parenttype, idx, parentfield columns to doctypes when transitioning from normal -> child table

* fix: remove parent, parenttype, parentfield, idx from DocType DocType
2022-02-07 15:12:37 +05:30
Ankush Menat
1cd4722235
fix: use now instead of is_async in tests (#15893) 2022-02-07 14:00:26 +05:30
Mohammad Hasnain Mohsin Rajan
4ff86e1d63
revert: "refactor: set amended docname to original docname" (#15867)
* Revert: "refactor: set amended docname to original docname"

80d111baf2.

* test: test if amended doc has different name
2022-02-04 17:22:18 +05:30
Raffael Meyer
89922bae90
feat: utility methods for docstatus (#15515)
* feat: utility methods for docstatus

* refactor: use utility method for doctsatus

* refactor: enum for docstatus

* refactor: docstatus as property

* fix: set docstatus

* feat: docstatus extends int class

* test: docstatus of BaseDocument

* refactor: occurrences of docstatus

* fix: typo

* refactor: move docstatus to a separate file

* test: docstatus

* fix: sider
2022-02-04 07:41:25 +00:00
Gavin D'souza
4d00579667 fix: Skip data field validations for virtual field 2022-02-01 18:38:31 +05:30
Gavin D'souza
bd89a9de86 Merge branch 'develop' of github.com:frappe/frappe into dynamic-docfields 2022-02-01 18:14:58 +05:30
Gavin D'souza
5c4905dd37 feat(minor): Allow expressions in options for DocFields
This means you don't have to write a custom controller or change backend
code to use Virtual DocFields! Write it in the options column for the
virtual field in Customize Form

Added doc and safe globals (from safe_exec) into the evaluation
namespace
2022-02-01 18:08:27 +05:30
Gavin D'souza
66b09afda6 fix: Don't create DB column for Virtual DocFields 2022-02-01 17:48:02 +05:30
Gavin D'souza
9e3e3f804a feat: Virtual DocField
Add virtual docfield through which you can make callable properties for
the controller
2022-01-27 22:38:48 +05:30
Gavin D'souza
6c83d82d14 Merge branch 'develop' of github.com:frappe/frappe into dynamic-docfields 2022-01-27 18:50:57 +05:30
Gavin D'souza
d01688bf2d fix: Don't set creation time during doctype sync 2022-01-27 18:33:26 +05:30
Rucha Mahabal
66c8fb9cfa fix: validate doc naming when set via prompt or by passing set_name 2022-01-27 12:24:22 +05:30
gavin
d78b496208
fix(Custom DocPerm): Use Link type instead of Data for parent (#15715)
* fix: Use Link type instead of Data for parent

This makes sure frappe.rename_doc updates linked doctype records

* Revert "fix: Use Link type instead of Data for parent"

This reverts commit 93b37351069df9a79f04bfa326378f09bf97700f.

* fix(rename_doc): Handle re-linking Custom DocPerm records
2022-01-25 11:14:34 +00:00
barredterra
b1383df15a refactor: use is None instead of == None 2022-01-17 10:37:51 +01:00
mergify[bot]
2ea25f0baa
Merge pull request #15615 from ankush/perm_import
fix: AttributeError when calling frappe.permissions.$function
2022-01-14 12:52:56 +00:00
Ankush Menat
d09fd25ad7 fix: import permissions
For some reason not importing this is causing issue with running the
functionality directly; specifically when running from background job.
2022-01-14 18:03:41 +05:30
Rushabh Mehta
853287f49d fix: load user_info on-demand 2022-01-13 16:39:24 +05:30
Gavin D'souza
6502c4b340 fix: Don't add property value if NoneType or Falsy 2022-01-12 16:02:43 +05:30
Gavin D'souza
d9daefc54d fix: Calculate dynamic properties for as_dict
If you have a @property in the controller class, this data used to not
be accessible anywhere other than directly through the object via
`frappe.get_doc`. This fix changes that.
2022-01-12 12:46:08 +05:30
mergify[bot]
6f8f792c01
Merge pull request #15574 from resilient-tech/fix-limit-in-get-method
fix: limit in `Document.get`
2022-01-11 08:18:12 +00:00
Pruthvi Patel
d1852242a0 fix: limit in Document.get 2022-01-10 15:52:25 +05:30
Gavin D'souza
981564e544 Merge branch 'develop' into frappe-postgres-changes 2022-01-07 11:37:28 +05:30
Gavin D'souza
d9b571cf43 refactor(minor): DatabaseQuery.prepare_select_args
* Used regex to replace instead of re-iteration (for-loop)
* Used f-strings for better readability
* Renamed and re-ordered vars, code block
2022-01-07 11:35:52 +05:30
Conor
55392b64e7 fix: Revert changes made to fix collation differences
Due to collation differences in MariaDB and Postgres, tests gave
inconsistent results. This was to be handled in tests alone instead of
the application. It was unnecessary. Collation changes should be made at DBMS config
level only. Accomodating for those in the application will unnecessarily
degrade performance for everyone.

Other changes:
* use pluck in user_type
* revert ordering in nestedset
* revert parsing in order_field
* use preferred APIs & styling

Co-authored-by: gavin <gavin18d@gmail.com>
2022-01-07 10:45:10 +05:30
Conor
1c40881c41 fix: refactor postgres arg prep into its own function 2022-01-07 10:45:05 +05:30
Conor
40ba1ac9ba fix: Postgres Compatibility
* Handle inconsistencies in type handling in DatabaseQuery & Database
  APIs
* Update incompatible queries with frappe.qb notation
* Fixed use cases discovered by failing ERPNext CI tests

fix: db independent syntax for user_type

fix: handle postgres datetime values

feat: add ability to auto commit on db inserts

feat: add ability to escape underscore in postgres

fix: handle missing data in test runner bootstrapping

fix: db independent syntax for queries

fix: refactor to use qb

fix: update cache for language

fix: use pluck in email_queue

Co-authored-by: gavin <gavin18d@gmail.com>

fix: don't auto insert on tests for make_property_setter

fix: remove auto_commit in custom_field insertion

fix: remove auto_commit functionality

fix: review comments

fix: revert link validation

fix: style suggestion for readability

Co-authored-by: gavin <gavin18d@gmail.com>

fix: revert .lower() in link validation

fix: add rollback for setup_wizard

Revert "fix: add rollback for setup_wizard"

This reverts commit 83b3b0913db17718ccd5edae01858cff15603829.

Revert "feat: add ability to escape underscore in postgres"

This reverts commit 8ed9c2aa3306438e94bb813f60e65b416d0b947b.

fix: more concise representation of order fields

Co-authored-by: gavin <gavin18d@gmail.com>
2022-01-07 10:44:57 +05:30
Verequies
379342d0ca fix: Postgres Compatibility for Standard Views
Core/User DocType: Add 'group_by' for PostgreSQL

Signed-off-by: Verequies <hamishclaxton@gmail.com>

fix: Postgres Compatibility for Standard Views

Desk/Dashboard DocType: Fix lowercase table name

Signed-off-by: Verequies <hamishclaxton@gmail.com>

Desk/Page/Setup Wizard: Fix data not being commited to database

Signed-off-by: Verequies <hamishclaxton@gmail.com>

Model/db_query: Fix queries with order_by and group_by for PostgreSQL

Signed-off-by: Verequies <hamishclaxton@gmail.com>

Model/db_query: Fix order_by without table name for PostgreSQL

Signed-off-by: Verequies <hamishclaxton@gmail.com>
2022-01-06 14:02:23 +05:30
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