Ankush Menat
64c221343e
perf: skip ifnull checks on modified field ( #24042 )
2023-12-30 06:39:32 +00:00
Corentin Flr
42fbb58626
fix(document): Pass parent_doc and parentfield in _set_defaults
2023-12-23 20:40:52 +01:00
Ankush Menat
4d68a46b10
fix: Set default child table fields on save ( #23913 )
...
We set defaults on creation of new doc but when you append a new child
doc on existing document it doesn't seem to set the defaults.
This seems like a bug and not a deliberate choice.
2023-12-22 08:02:36 +00:00
Ankush Menat
5e2ace4c08
perf: Use set for tracking whitelisted methods ( #23905 )
...
List look ups are O(N). This is still a microoptimization at best
considering other overhead.
2023-12-21 23:19:06 +05:30
Ankush Menat
0fd6f5eed7
Merge pull request #23827 from frappe/api-docs
...
docs: add Python API missing docstrings / type hints
2023-12-21 12:13:05 +05:30
bourouffala
3015852ce1
fix: Error when displaying dashboard with number card using average and sum functions ( #23883 )
2023-12-20 11:13:20 +00:00
Ankush Menat
052a2527dd
Merge pull request #23874 from ankush/del_check_links
...
fix: don't allow deleting original doc if amendment exists
2023-12-20 14:13:41 +05:30
Ankush Menat
b51a479fc2
fix: don't allow deleting original doc if amendment exists
2023-12-20 13:11:34 +05:30
Ankush Menat
5ecacd0cd7
Merge pull request #23865 from ankush/no_virtual_select_star
...
fix: skip virtual fields in perm level checks during DB Query
2023-12-20 12:15:48 +05:30
Ankush Menat
5deabdde21
fix: skip virtual fields in perm level checks during DB Query
...
DB Query can't access virtual fields so it should ignore all virtual
fields.
2023-12-20 12:00:08 +05:30
Akhil Narang
178b699466
Merge pull request #23432 from marination/doc-connections
...
fix: Treat Document Links entries as all non-std fields
2023-12-19 16:05:58 +05:30
Hussain Nagaria
8d2137c265
docs: consistent doc strings
2023-12-18 18:27:39 +05:30
Ankush Menat
687752359d
perf: Primary key is never nullable ( #23788 )
...
People ususally write queries like these...
```
frappe.get_all(doctype, {"name": ("in", list_of_docs))
```
Ocassionally, the `list_of_docs` is empty because it's dynamically
generated and in this case we end up doing full table scan to find... nothing!
2023-12-14 15:01:19 +00:00
Smit Vora
f62f4472e6
fix: ignore if controller doesn't have get_list attr ( #23736 )
2023-12-11 23:24:00 +05:30
Shariq Ansari
52cea3e01c
chore: better code
2023-12-08 15:49:33 +05:30
Shariq Ansari
78cf0cd142
fix: check if autoname is promt before setting __newname
2023-12-08 10:53:58 +05:30
Sagar Vora
d74e5d2e8a
chore: fix typo in comment
2023-12-07 09:31:53 +05:30
barredterra
c35476256f
refactor: simplify conditional logic
...
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Ankush Menat
ebbd3cd137
fix: skip overriden doctypes during orphan check ( #23518 )
...
These are prone to breakage and shouldn't be deleted automatically.
This mostly works fine but there can be cases where it doesn't. So best to leave them untouched.
2023-11-30 11:33:42 +00:00
Ankush Menat
286e0a7b96
fix: Always evaluate Virtual Fields ( #23515 )
...
Related: https://github.com/frappe/frappe/issues/23475
Likely caused by: https://github.com/frappe/frappe/pull/22110
Because run_doc_method passes doc from client to server side, we end up
setting values for what is a "virtual field", this is why it finds some
value and not re-evaluate it.
IMO there are only mild breaking ways of fixing this:
1. Virtual fields should always be computed.
2. Virtual fields should not be set when init-ing the arguement. (e.g. from doc.set APIs )
2023-11-30 16:22:22 +05:30
Deepesh Garg
20a7521c92
chore: Provision to ignore child mapping using get mapped doc
2023-11-26 14:33:42 +05:30
marination
d4129721ce
fix: Treat Document Links entries as all non-std fields
...
- Since the field name is specified use it as a non standard field because it is hard to determine which field is standard. It is often wrong to assume the first entry has the statndard field
2023-11-24 16:39:50 +01:00
Ankush Menat
e8fe3b2166
Merge pull request #23414 from ankush/bulk_actions_bg
...
perf: run bulk actions using background jobs
2023-11-24 18:33:38 +05:30
Smit Vora
bf50952662
fix: after_mapping hook to run custom mapping functions
2023-11-24 17:45:38 +05:30
Ankush Menat
6cf168a56f
fix: bulk workflow action in background
2023-11-24 17:04:09 +05:30
ruthra kumar
1e0920409f
fix: ignore dynamic fields in virtual doctypes
2023-11-23 14:49:28 +05:30
Ankush Menat
d715b0ad31
Merge pull request #22804 from akhilnarang/non-nullable-fields
...
feat: allow setting fields as not nullable
2023-11-20 12:46:02 +05:30
ruthra kumar
94b2e509b9
fix: dont rename link fields in Virtual doctypes
2023-11-20 10:11:42 +05:30
Shariq Ansari
729f8be0af
Merge pull request #23248 from anandbaburajan/rename_doc_and_field
2023-11-17 16:15:40 +05:30
anandbaburajan
ebccab0652
fix: copy any flags if required in rename_doc() only on validate
2023-11-17 00:32:28 +05:30
anandbaburajan
0aab6160a4
chore: validate arg for rename_field()
2023-11-17 00:31:04 +05:30
Akhil Narang
731c5c8cd5
refactor(db_query): check for docfield not_nullable
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 14:51:57 +05:30
Akhil Narang
10ad99869a
feat: use user-specified default value if passed
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 14:51:57 +05:30
Akhil Narang
15c925ccc7
feat: check for docfield not_nullable property to decide whether a field can be nullable
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 14:51:57 +05:30
Akhil Narang
390d4e1b13
chore: drop unused variables and parameters
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 14:51:57 +05:30
Akhil Narang
75709eede7
feat: set a non-null value if docfield isn't set as nullable
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 14:51:57 +05:30
Akhil Narang
18867b273f
chore: make return type annotation make more sense
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 14:51:57 +05:30
David Arnold
91e22446d2
Merge remote-tracking branch 'upstream/develop' into feat/into-child-mapper
2023-11-13 10:03:38 +01:00
Ankush Menat
47c3151662
fix: remove data import legacy leftover fields ( #23113 )
...
* fix: clear last message if ignoring DNE
* fix: attempt to delete data import legacy leftover fields
2023-11-06 19:18:39 +05:30
Ankush Menat
cc9e92572b
perf: dont query ignored link doctypes
...
Currently the code first queries and then ignores, just don't query linked doctypes if they are ignored via validation.
2023-10-31 15:14:24 +05:30
Ankush Menat
6926669577
perf: Ignore amended_from link fields in link field checks
...
Small perf benefit at not much cost. `amended_from` are *always*
refererring to cancelled documents so there's no need to check these
fields.
2023-10-31 15:03:08 +05:30
Marica
6b1ec4703d
fix: Validate invalid links in fetch_from dependency fields ( #22993 )
2023-10-30 18:43:41 +05:30
gavin
8e7cd47d3d
feat: Document.remove_tag ( #22970 )
...
Added remove_tag API for consistency
2023-10-30 16:10:20 +05:30
Ankush Menat
1560fa8610
fix: ignore stale custom fields while checking back-links ( #22940 )
...
* fix: ignore non-existing back-links
* refactor: less indentation, guard clauses
2023-10-27 14:07:58 +05:30
Ankush Menat
385fa8aaef
fix!: Correct between filtering ( #22918 )
...
* fix: Remove incorrect fallback
If you do +1 on date it will also start considering next date. This was
only done to accomodate date filter on datetime fields. Which also
doesn't really work.
* refactor: simplify fieldtype detection
* fix!: Correct datetime fallbacks for between filters
* chore: remove unncessary test
This is very specific and introduces flake when the job tests run before
it.
2023-10-26 06:23:14 +00:00
Maharshi Patel
409a3a8105
Merge branch 'develop' into fix-attach-before-doc-save
2023-10-19 11:40:20 +05:30
Ankush Menat
018ed845bd
refactor: defer unnecessary json-dumping of messages
...
Also avoid accessing locals where interface is present like for popping last message.
2023-10-16 18:13:50 +05:30
Ankush Menat
d5a21a2676
fix: rename type validation
...
`None` can be passed which is acceptable here.
TODO: Make slackdict accept none as bool and convert to False
2023-10-16 18:12:53 +05:30
Ankush Menat
11dd961d81
refactor!: Method whitelisting
...
Document.whitelist doesn't work, no idea why it's doing all weird
`__func__` business.
`@frappe.whitelist()` works just fine.
2023-10-16 18:12:53 +05:30
Ankush Menat
52d6bd67e4
fix: Always return document from doc.insert
2023-10-13 15:34:03 +05:30