Commit graph

75 commits

Author SHA1 Message Date
Prssanna Desai
12a3dc1124 feat(desk): Show preview popover on hover of link and control fields 2019-04-24 15:09:41 +05:30
Prssanna Desai
c062b388a7 Improve preview popover 2019-04-24 15:09:41 +05:30
Prssanna Desai
f2391ff87a Add preview popover on hover to all link fields 2019-04-24 15:09:41 +05:30
Suraj Shetty
fbf67b78b1 Move get_safe_filters to frappe.utils 2019-03-11 19:41:50 +05:30
Aldo
67eb4d7245 fix: typo in frappe.client.attach_file which resulted in error (#6977)
It returned `f.as_dict()`. `f` is not declared in the current scope.\Changed it with `_file`.
`return _file.as_dict()`
2019-02-25 11:33:26 +05:30
Ameya Shenoy
13524a1ad5
Merge branch 'staging' into develop 2018-11-23 08:14:29 +00:00
Ameya Shenoy
d1d0edc636
Merge branch 'master' into staging-fixes 2018-11-23 08:07:36 +00:00
rohitwaghchaure
a3f63ca1bd fix: Child table data can be get easily by passing fake parent id (#6509) 2018-11-22 10:24:06 +05:30
Ameya Shenoy
f0f8851809
fix: commonify json.loads for filters 2018-10-23 13:20:05 +05:30
Suraj Shetty
32f8ae5c81 Fix count filter load 2018-10-21 09:52:12 +05:30
Chinmay Pai
6e84bbe80d
Merge branch 'develop' into file-api 2018-09-21 13:42:32 +05:30
Chinmay Pai
75c7992557
file-api: add new test, fix minor bugs and code indentation
Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-09-21 13:40:25 +05:30
Faris Ansari
89d56e4de1 fix(translations): Replace translations by keyword with indexed version
Keywords in the translation also gets translated which
results in an error because python cannot find the key
2018-09-18 11:55:10 +05:30
Chinmay Pai
5bd66f134d
file-api: add improvements to save() api
file can now be saved by calling save() on the file object instance

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-09-13 09:46:48 +05:30
Chinmay Pai
6eca292e1a
[3/3] file-api: code migration
migrate api from file_manager.py to file.py

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-09-06 01:18:21 +05:30
Chinmay Pai
16a99f5472
[1/3] file-api: code migration
migrate api from file_manager.py to file.py

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-08-31 01:55:15 +05:30
Suraj Shetty
14c621fca2 Success Action (#5434)
* success model init

* ui changes

* whitelisted get_count method

* refactor success action

* refactor form.js
- lint error fixes
- reject promise on error

* Refactor
- option to add body to msg-alert
- remove unwanted css
- tweak msg-alert ui

* remove alert on any action click

* sample success modal config for toDo

* success alert redesign

* docstatus check

* close button position fix

* add doctype for success action setting

* remove unwanted changes

* remove unused import

* rename success action setting to success action

* add translatable label

* rename for_doctype to ref_doctpe

* remove unused frappe import

* replace get_list with get_all
to ignore permission check while loading boot
2018-04-18 11:22:51 +05:30
Achilles Rasquinha
e1be2a19c6 Added Quick Edit 2018-03-31 12:57:24 +05:30
Nabin Hait
cc251a0869 Fixed merge conflict 2018-03-29 13:52:00 +05:30
Ameya Shenoy
a5788e1746 Child table permission error fix (#5311)
Initially there were no permission checks on child table, which made the
child table data exposable through the API. The fix issued in commit
807a300fd8 involved default denying
permission to access child tables via client.py . The current fix checks
the permissions on the parent doctype and allows access if the user has
access on the parent
2018-03-29 13:11:36 +05:30
Nabin Hait
b455d90631 Merge branch 'master' into develop 2018-03-28 08:43:50 +05:30
Rushabh Mehta
807a300fd8 [hotfix] dont allow API query for child table 2018-03-28 06:41:56 +05:30
Dominik Ottenbreit
cc19e06ed7 Fix docstring information to be clear (#5025)
* Fix docstring information to be clear

Updated the docstrings due to errors I encountered:
* `is_private` must be 1, normally would expect true or false
* `filedata` must be urlencoded base64 to work

* Update client.py
2018-02-19 11:20:29 +05:30
Revant Nandgaonkar
856cbfa675 Attach file via ReST API (POST) (#4965)
* Attach file via ReST API (POST)

* [Fix] import save_file

* request body as param, validate request method

* explicit naming - decode_base64
2018-02-12 17:06:58 +05:30
Achilles Rasquinha
eb229ad14b Fixed Codacy 2018-01-18 16:57:04 +05:30
Achilles Rasquinha
f0697b65a1 added get_single_value 2018-01-15 14:55:13 +05:30
Rushabh Mehta
cd968348d7 [minor] better message on permission 2017-10-16 10:18:56 +05:30
Shreya Shah
c5cf341f48 integer conversion fix (#4085) 2017-09-09 10:45:51 +05:30
Makarand Bauskar
6fa9967a04 [hotfix] throw DoesNotExistError if doctype is not available on Delete api (#4013)
* [hotfix] throw DoesNotExistError if doctype is not available on Delete api

* [fixes] aded tests cases and codecy, travis fixes
2017-09-01 09:16:32 +05:30
Aditya Hase
769338f136 Replaced all instances of basestring with six.string_types 2017-08-11 00:10:11 +05:30
Revant Nandgaonkar
f8387ac039 added whitelisted function get_time_zone (#3843) 2017-08-07 18:02:48 +05:30
Nabin Hait
e504671de8 Minor fix in client.get_value (#3852) 2017-08-03 17:01:16 +05:30
RogueRonin
4776011cbc check whether the used filters were really parseable and usable and did not just result in an empty string or dict (#3822) 2017-08-02 16:55:46 +05:30
Makarand Bauskar
465d6b3431 [minor] fixes in frappe.client.get_value method (#3830) 2017-08-01 16:42:28 +05:30
tundebabzy
bbde2ec4cf rewrite use of dict.iteritems (#3498)
* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility
2017-06-19 09:10:21 +05:30
Mohammed R Abukhamseen
f5a904a897 Exception translatable (#3473)
* Add persian right to left

* Update locale-all.js

Add Arabic translation for datepicker

* Make Exception translatabl with better UI

* Update desk.js
2017-06-16 11:11:56 +05:30
exabakr
df6a1ce686 [URGENT] Prevent accessing sensitive files in client.get_js
Logged in user (any permissions) can access sensitive files by calling frappe.client.get_js

Consider the following scenario:
1- Login to system
2- http://HOST/?items=["currentsite.txt"]&cmd=frappe.client.get_js  (this will give you site directory name)
3- http://HOST/?items=["SITE_DIR_NAME%2Fsite_config.json"]&cmd=frappe.client.get_js (this will show you site config including database name and password and any other sensitive data

The suggested fix prevent accessing any file outside the assets folder. (or atleast you should prevent access to .py files and private folder which includes backup and sensetive files and logs folders)

There should be a hot fix asap
2016-11-30 04:04:24 +03:00
Rushabh Mehta
819983a7b6 Merge branch 'master' into develop 2016-11-16 11:20:42 +05:30
Rushabh Mehta
c5551201e4 [fix] frappe.client.set_value for unsetting value (#2323) 2016-11-16 11:08:39 +05:30
Rushabh Mehta
638816acd0 [docs] for frappe client #2209 2016-11-08 12:24:20 +05:30
Rushabh Mehta
89a77016a5 [minor] dont show disabled roles in permission manager (#2180) 2016-10-25 10:59:41 +05:30
Rushabh Mehta
512fc3a5c2 [feature] [api] frappe.client.insert_many 2016-08-09 11:09:31 +05:30
Anand Doshi
2162b695d4 [api call] frappe.client.get_password 2016-07-24 14:09:50 +05:30
Maxwell Morais
3a23409239 Fix: TypeError: unhashable type: 'dict'
```python
Traceback (innermost last):
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/__init__.py", line 805, in call
    return fn(*args, **newargs)
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/client.py", line 79, in insert
    parent.append(doc)
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/model/base_document.py", line 130, in append
    if not self.__dict__.get(key):
 TypeError: unhashable type: 'dict'
```
2016-05-14 23:18:52 -03:00
Maxwell Morais
d1c6c9f0f1 Fix: AttributeError: 'dict' object has no attribute 'parenttype'
```python
Traceback (innermost last):
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/__init__.py", line 805, in call
    return fn(*args, **newargs)
  File "/usr/frappe5/frappe-bench/apps/frappe/frappe/client.py", line 78, in insert
    parent = frappe.get_doc(doc.parenttype, doc.parent)
 AttributeError: 'dict' object has no attribute 'parenttype'
```
2016-05-14 23:14:54 -03:00
Rushabh Mehta
fe330d3209 [cleanup] frappe.require 2016-04-26 12:58:30 +05:30
Rushabh Mehta
6f2b58c095 [fix] control.js for read only values 2016-04-25 17:53:13 +05:30
Anand Doshi
569f2f068a [fix] get_js 2015-11-17 18:28:37 +05:30
Rushabh Mehta
d924fd1715 [fix] [minor] 2015-05-05 17:41:23 +05:30
Rushabh Mehta
5034e7e660 [api] add frappe.model.get_value in js (gets value from serverside) 2015-03-05 11:58:40 +05:30