Commit graph

38477 commits

Author SHA1 Message Date
Ankush Menat
a7f9c2a672 chore: remove migrate 2022-06-16 14:10:01 +05:30
Ankush Menat
1c385826ef test: make sure all patches are in patch.txt 2022-06-16 14:10:01 +05:30
Ankush Menat
214be6a7e8 chore: discard stale patches, add relevant ones to patches.txt 2022-06-16 14:10:01 +05:30
Ankush Menat
f7e00633b9 chore: useless flake8 warnings 2022-06-15 17:27:04 +05:30
Suraj Shetty
c7e89267cc
Merge pull request #17151 from phot0n/fix-format-date-dashboard-charts 2022-06-15 16:26:20 +05:30
gavin
dc7100757c
Merge pull request #17200 from gavindsouza/fix-qb-patched
fix: Patch qb for different schemas in same process
2022-06-15 16:15:37 +05:30
Suraj Shetty
444c2db1c4
Merge pull request #17124 from s-aga-r/fix/user-type 2022-06-15 16:13:31 +05:30
Suraj Shetty
77a6c103ec test: Fix dashboard chart test cases 2022-06-15 16:11:55 +05:30
Ankush Menat
8436acbecb
Merge pull request #17174 from gavindsouza/pyproject-filt
build!: Declarative builds via pyproject.toml
2022-06-15 16:10:41 +05:30
Suraj Shetty
2568e8a1ac
Merge branch 'develop' into fix-format-date-dashboard-charts 2022-06-15 16:03:02 +05:30
Gavin D'souza
36fa2122a3 fix: Patch qb for different schemas in same process
You would want to switch schemas in the same process. Eversince the
change
64e5273764
we stopped patching on every frappe.init call which meant, if a MariaDB
site was initialized first, frappe._qb_patched would be set to True and
if a Postgres site was initialized after, _qb_patched would be lying as
the PG engine isn't patched yet. Sooooo we need a Dict instead to
maintain this record of patching. This issue caused weird errors lol -

Traceback:

  File "/home/frappe/Desktop/frappe-bench-dev/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/commands/site.py", line 524, in migrate
    SiteMigration(
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/migrate.py", line 169, in run
    self.setUp()
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/migrate.py", line 73, in setUp
    clear_global_cache()
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/cache_manager.py", line 102, in clear_global_cache
    clear_website_cache()
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/website/utils.py", line 374, in clear_website_cache
    clear_cache(path)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/website/utils.py", line 369, in clear_cache
    for method in frappe.get_hooks("website_clear_cache"):
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/__init__.py", line 1440, in get_hooks
    hooks = _dict(_load_app_hooks())
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/caching.py", line 57, in wrapper
    return_val = func(*args, **kwargs)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/__init__.py", line 1407, in _load_app_hooks
    apps = [app_name] if app_name else get_installed_apps(sort=True)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/caching.py", line 57, in wrapper
    return_val = func(*args, **kwargs)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/__init__.py", line 1374, in get_installed_apps
    installed = json.loads(db.get_global("installed_apps") or "[]")
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/database/database.py", line 917, in get_global
    return self.get_default(key, user)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/database/database.py", line 921, in get_default
    d = self.get_defaults(key, parent)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/database/database.py", line 938, in get_defaults
    defaults = frappe.defaults.get_defaults(parent)
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/defaults.py", line 88, in get_defaults
    globald = get_defaults_for()
  File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/defaults.py", line 218, in get_defaults_for
    frappe.qb.from_(table)
TypeError: 'Field' object is not callable
2022-06-15 15:55:43 +05:30
Suraj Shetty
675e72506c
Merge pull request #17132 from nabinhait/minor-fixes 2022-06-15 15:42:56 +05:30
gavin
6c8b22a5d5
Merge branch 'develop' into pyproject-filt 2022-06-15 15:25:55 +05:30
Gavin D'souza
21bad02b72 ci: Remove dependency on requirements.txt for builds 2022-06-15 15:25:26 +05:30
Gavin D'souza
59ab6531c9 ci: Invalidate GHA pip cache on pyproject or setup changes
- Cache invalidated if any of the files change: *requirements.txt,
pyproject.toml, setup.py or setup.cfg
- Updated boilerplate for new apps too
2022-06-15 15:05:37 +05:30
Ankush Menat
5affa2248d
fix: pass parent doctype on client.get_value (#17196) 2022-06-15 14:59:25 +05:30
Suraj Shetty
b638291b5d
Merge pull request #17189 from frappe/mergify/copy/develop/pr-17116
fix: no add/change image-field if user is not allowed (copy #17116)
2022-06-15 14:14:52 +05:30
Ankush Menat
b36bf64261
chore: revert naming to default (#17194) 2022-06-15 13:35:21 +05:30
Ritwik Puri
5b08657613
Merge branch 'develop' into fix-format-date-dashboard-charts 2022-06-15 13:05:18 +05:30
Suraj Shetty
ac937cda5a
Merge pull request #17179 from shariquerik/read-only-field-fix 2022-06-15 12:55:49 +05:30
Nabin Hait
b8a1d06363 fix: Global datetime format: show AM/PM in capital letter 2022-06-15 12:55:04 +05:30
Nabin Hait
c2ce0ed8c1 fix: set first tab active after routing 2022-06-15 12:55:01 +05:30
Suraj Shetty
dcf7252fba fix: Add image_field check
(cherry picked from commit e48f6620646e213526b7ba5614779558e729c638)
2022-06-15 07:24:21 +00:00
RJPvT
70c4305b53 Update user_image.js
(cherry picked from commit d9d3b1421e5516fa8471e5afedebed99ed3bd095)
2022-06-15 07:24:20 +00:00
RJPvT
4937b3d17f fix: no add/change image-field if user is not allowed
no add/change image-field (dropdown) if user is not allowed to change

(cherry picked from commit 4af5006470739a11ddcf3141c95ae6fb157d6825)
2022-06-15 07:24:20 +00:00
phot0n
57a4d590d0 test: test_user_date_label_dashboard_chart 2022-06-15 12:49:29 +05:30
Ankush Menat
620852a100
Merge pull request #17159 from ankush/log_settings
refactor!: improve/extend log settings
2022-06-15 12:47:43 +05:30
Ankush Menat
8a7458ac57 feat(ux): show log retention policy in sidebar
for discoverablity
2022-06-15 12:33:17 +05:30
Ankush Menat
c380d4a1b8 refactor: dont delete route history by default
It can still be added to log settings manually.
2022-06-15 12:33:17 +05:30
Ankush Menat
a1fa2353c1 fix: clear pending logs using big-deletes
If some sites have long pending old data that doesn't get cleared
automcatically then this patch now attempts to discard old data by using
"big-delete" code instead of typical delete query.
2022-06-15 12:33:14 +05:30
Ankush Menat
f1271b78de test: ensure temp tables are removed exist 2022-06-15 12:30:38 +05:30
Ankush Menat
edbb44925e refactor: better varname and use get_table_name
Co-Authored-By: gavin <gavin18d@gmail.com>
2022-06-15 12:30:38 +05:30
Ankush Menat
d3bb434e3c fix(ux): make log setting grid editable 2022-06-15 12:30:38 +05:30
Ankush Menat
aeb5034a96 refactor: slightly resilient patch and defaults 2022-06-15 12:30:38 +05:30
Ankush Menat
8b8552b0e4 feat: clear-log-table to clear large log tables 2022-06-15 12:30:38 +05:30
Ankush Menat
95eb6cd085 feat: support log clearing for more doctypes
- Route History
- Error Snapshot
- Scheduled Job Log (only completed ones)
2022-06-15 12:30:38 +05:30
Ankush Menat
ea416f9d6b feat: log settings with "interface"
We have hardcoded "Log settings" to only apply on 3 doctypes, there are
few more logging doctypes in core which are not cleared right now, on
top of that it's not easy for user to configure all logging behaviour
from one place.

This change adds a table on log settings where logging doctypes that
support the interface required by log settings can auto-register and
show up in settings.

Currently only supported configuration is "number of days" to keep.
2022-06-15 12:30:38 +05:30
Ankush Menat
ef1200d94b fix!: dont auto set old logs as "seen"
Not sure why this is ever required, also not configurable.
2022-06-15 12:30:38 +05:30
Ankush Menat
6d5aa88e66
Merge pull request #17187 from gavindsouza/get_singles_dict-cast
refactor!: Don't cast values of frappe.db.get_singles_dict by default
2022-06-15 11:18:09 +05:30
Gavin D'souza
57bd1b6031 fix(db): Import cast as cast_fieldtype to manevour ambiguity 2022-06-15 10:54:48 +05:30
gavin
cfdde0cfff
Merge branch 'develop' into pyproject-filt 2022-06-15 10:48:26 +05:30
Gavin D'souza
80b19a6031 fix: Cast singles_dict' values
This is to adapt with the changes made in frappe.db.get_singles_dict in
the previous commit
2022-06-15 10:40:26 +05:30
Gavin D'souza
bbc90e6578 refactor!: frappe.db.get_singles_dict
* Don't cast values by default - only if cast kwarg is set
* Reverts breaking behaviour added via f74dc5023d
2022-06-15 10:33:06 +05:30
Rushabh Mehta
562499609c
fix(minor): refresh tabs with sections (#17182) 2022-06-14 19:00:01 +05:30
Shariq Ansari
af74eee7b8
Merge branch 'develop' into read-only-field-fix 2022-06-14 18:58:57 +05:30
Shariq Ansari
c77f36600a chore: code cleanup 2022-06-14 18:58:28 +05:30
Shariq Ansari
4bc544bb0b fix: validation in date range while parsing 2022-06-14 18:40:36 +05:30
gavin
074891c53f
Merge branch 'develop' into pyproject-filt 2022-06-14 18:22:50 +05:30
Gavin D'souza
cb28af838e fix: Add temporary backwards compatible setup.py
setup.py is maintained so that there is no hard dependency on bench
v5.11.0 and people get enough time to update their CLI. Hope the TODO
adds a subtle reminder for the future ;)
2022-06-14 18:21:48 +05:30
Shariq Ansari
e5bc96d4d8 fix: added validation in parse method for table multiselect and multiselect pills 2022-06-14 18:19:11 +05:30