Commit graph

163 commits

Author SHA1 Message Date
Ankush
257723cb0a
feat: PythonExpression and Python option with syntax validation for Code field types (#13707)
* feat: `PythonExpression` and `Python` options for `Code` fields

* fix: check python expressions in assignment rule

* fix: replace server script syntax validation

* fix: validate condition in workflow transition

Add PythonExpression in Options.
2021-08-06 04:10:09 +00:00
Deepesh Garg
4c400bd6c9 test: Custom internal links addition 2021-08-04 17:10:33 +05:30
Deepesh Garg
252850be98 fix: Internal link support for custom document links 2021-07-31 15:46:54 +05:30
Gavin D'souza
c489846547 Merge branch 'develop' into unnecessary_comprehensions 2021-06-11 19:30:23 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Ankush Menat
4754ab71d1
perf(minor): remove unnecessary comprehensions
- remove several unnecessary comprehensions from functions that accept a generator.
- Using `[x for x in iter]` causes a list to be built first then passed to the outer function.
- `any` and `all` can take generator instead. This makes memory usage O(1) and actually makes these functions short-circuiting. E.g. if the first condition fails then `all` will immediately return false instead of evaluating all the entries.
- `sum`, `min`, `max` => memory usage become O(1)
- `list`, `set`, `.join()` => roughly halves memory usage, as list is not required to be built.
- lastly, it's two fewer characters to read/think about.
2021-05-12 20:38:18 +05:30
leela
72ca7e9753 refactor: remove six dependency 2021-05-07 07:42:04 +05:30
Suraj Shetty
7e5f86789c fix: Do not check permlevel > 0
- while creating has_access_to list
2021-03-23 19:53:05 +05:30
Suraj Shetty
6f774d6d0c
fix: Check for fieldlevel permission for report query (#12163)
Co-authored-by: Prssanna Desai <prssud@gmail.com>
2021-01-28 17:14:47 +05:30
Shivam Mishra
26e40a9d68
fix: data.non_standard_fieldnames is None (#12174)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2021-01-13 19:24:24 +05:30
Anurag Mishra
c88ef9d603 feat: removed Roles from special documents 2021-01-08 17:33:06 +05:30
prssanna
69befda08e fix: label for _assign field 2020-12-04 16:12:22 +05:30
Rushabh Mehta
742605542c fix(minor): added ignore_ddl in frappe.db.get_all to ignore missing tables, columns 2020-10-26 10:02:04 +05:30
Rushabh Mehta
8707ed1f27 fix(minor): remove "Custom Link" and add patch 2020-10-26 10:02:04 +05:30
Rushabh Mehta
92c30ae212 fix(minor): linting 2020-10-26 10:02:04 +05:30
Rushabh Mehta
a0a3606a7f fix(tests): add test cases for custom_link and custom_action 2020-10-26 10:02:04 +05:30
Rushabh Mehta
b5cb39bdb1 fix(minor): fix fieldame in apply_property_setters in model/meta.py 2020-10-26 10:02:04 +05:30
Rushabh Mehta
1e48ced097 feat(customize form): add links and actions to customize form and cleanup code 2020-10-26 10:02:04 +05:30
Shivam Mishra
8e815552f6 feat: use blog_post_list as default 2020-06-01 19:15:00 +05:30
SDLyu
3e9d8d05e9
Wrappe frappe._dict
`frappe.get_attr(hook)(data=data)` return dict. But function `get_open_count` will access `fieldname` attribute in notifications.py.
 I will cause error `'dict' object has no attribute 'fieldname'`.
2020-05-21 18:47:00 +08:00
Himanshu Warekar
12ca630c52 fix: merge code 2020-05-14 17:22:51 +05:30
Himanshu Warekar
aa98d6ffb6 fix: sider changes 2020-05-14 16:37:14 +05:30
Himanshu Warekar
c14b6c592a fix: move code to meta.py 2020-05-14 16:27:34 +05:30
Himanshu Warekar
9bbcaf49a8 Merge branch 'develop' of https://github.com/frappe/frappe into custom_frm_dashboard 2020-05-13 11:54:12 +05:30
prssanna
4508c6be99 fix: fix error when group is set in link 2020-05-08 15:43:56 +05:30
Prssanna Desai
25884d2370
fix: Linking of doctype from links table (#10267)
* fix: fix linking of doctype from links table

* fix: use frappe._dict

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-05-08 09:59:29 +00:00
Rushabh Mehta
9724cc273a fix(minor): In add_doctype_links, use frappe._dict 2020-05-08 12:33:25 +05:30
Rushabh Mehta
9f26548b31 fix(minor): update web page test and allow dashboards for custom doctype 2020-04-19 18:01:06 +05:30
Himanshu Warekar
e61a5f0ea3 Merge branch 'develop' of https://github.com/frappe/frappe into custom_frm_dashboard 2020-04-08 18:47:42 +05:30
Himanshu Warekar
9e139171f4 feat: custom form dashboards 2020-04-08 18:35:49 +05:30
Suraj Shetty
ba6a73bd34
Merge branch 'develop' into data-options 2020-03-30 13:06:41 +05:30
Nabin Hait
a5fc3d82dd fix: Get valid columns from meta only if table exists (for doctype action) 2020-03-30 11:59:27 +05:30
Suraj Shetty
0a65266c1e
Merge branch 'develop' into data-options 2020-03-30 10:44:25 +05:30
Gavin D'souza
80c4167a07 feat: server validations for data field options 2020-03-25 15:23:36 +05:30
Suraj Shetty
8f8e361766 style: Fix formatting issues 2020-03-21 17:45:39 +05:30
Suraj Shetty
4c8d209c4c fix: Pass Meta instance to updatedb
- Check if Property Setter exists
2020-03-21 15:23:24 +05:30
Suraj Shetty
4d758bf191 fix: Typo 2020-03-21 12:51:02 +05:30
Suraj Shetty
af7e040d1a refactor: Get doc fields directly from meta 2020-03-21 12:30:03 +05:30
Deepesh Garg
f46b3d89a9 fix: Pass zero precision as string 2020-03-17 21:20:44 +05:30
Deepesh Garg
57bac6fff8 fix: Avoid unnecessary cint calls 2020-03-17 19:24:03 +05:30
Deepesh Garg
08287fa6f2 feat: 0 precision for currency fields 2020-03-17 09:10:45 +05:30
Saqib Ansari
3389042656 fix: currency field not found in print formats 2020-03-12 14:33:50 +05:30
Shivam Mishra
1898b2fb0e fix: use hasattr to verify links (#8938)
* fix: use hasattr to verify links

* fix: verify length explicitly

* style: remove unnecessary call to len
2019-12-03 07:11:04 +00:00
Rushabh Mehta
3e4e6d4b3f feat(doctype link): add links to doctype for link dashboard 2019-11-07 12:14:09 +05:30
Rushabh Mehta
7cd329fac9 reactor(scheduler): created "Scheduler Job Type" and cleaned up scheduler 2019-11-07 12:14:09 +05:30
Suraj Shetty
86263e05f4 perf: Cache db columns to avoid redundant database calls (#8543)
* perf: Cache db columns to avoid redundant database calls

* fix: Move cache clearing code from doctype to schema.py

* fix: self.table_name instead of self.name

* fix: Cache columns in  "table_columns" key

`table_columns` was cached in meta but columns were also getting accessed
directly using frappe.db.get_table_columns. Now, it is cached at
`frappe.db` layer

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2019-10-07 13:39:40 +00:00
Rohan
355fc4b49e feat: allow extending doctype dashboards via hooks (develop) (#8336)
* feat: allow overriding dasboards via hooks

* fix: allow extending dashboard data in hooks

* fix: move logic to generic function

* format: added description to hook
2019-09-08 02:29:43 +05:30
deepeshgarg007
041ada51f3 fix: Get cached value only if field present in doc 2019-07-11 15:07:58 +05:30
Frappe Bot
94ea028db3 Merge branch 'master' into develop 2019-03-08 09:38:18 +00:00
Sagar Vora
0483877c9d feat: New DocField "Fetch If Empty" 2019-02-26 21:46:15 +05:30