Commit graph

4438 commits

Author SHA1 Message Date
Ankush Menat
bfda3869a6
fix: delete email queue first (#16968)
email queue takes a long time and during that previously deleted tables
remain locked. Activity/Error logs are relatively faster to delete so
should moved last
2022-05-24 12:50:37 +05:30
gavin
6dedf899ff
Merge pull request #16899 from ChillarAnand/imports
refactor: Removed unused imports & added flake8 check in CI
2022-05-23 15:53:18 +05:30
Ron Ulitsky
65b1474cad
Update importer.py
fixed bug that returned incorrect extensions for file paths with directories containing full stops
2022-05-19 14:29:36 -05:00
chillaranand
25f82e966c refactor: Remove unused imports & code 2022-05-19 15:34:35 +05:30
Ankush Menat
fcb9597f88 fix: make error log reference fields read only 2022-05-19 15:02:43 +05:30
Suraj Shetty
e9e839af01 fix: Use duration field and update fieldname for reset password link expiry 2022-05-19 10:30:02 +05:30
Suraj Shetty
eb70f0aa9a
Merge branch 'develop' into develop 2022-05-19 09:25:00 +05:30
Himanshu
70409a3c7b
fix: set translated text to link field (#15451)
- Fixes [Issue/15324](https://github.com/frappe/frappe/issues/15324)
- When selecting a value for Link Field, the English text was set as link field value.
- This PR aims to fix it by setting the translated text as link field value on selection.

Todo:

- [x] Show translated text in the select dropdown
- [x] Set translated value to Link field on select
- [x] Show original value when link field is in focus
- [x] Add option to toggle this behaviour

### Behaviour

- Link field loses focus: show the translated name.
- Link field is focused
    - If old value is present
        - If options **are** one of [Role, DocType]: show the translated name
        - Else: show the name (untranslated) to enable search in untranslated values
    - Else: show what the user typed (untranslated) to enable search in untranslated values
- Value is selected: link field loses focus

## Demo

### Link to UOM in a custom Item DocType

The UOM names are in english, so the search needs to happen in english. When possible, the translation is displayed.

#### Before

https://user-images.githubusercontent.com/14891507/156415248-e5e80d05-53dc-4ca8-89c7-998986ff6e99.mov

#### After

https://user-images.githubusercontent.com/14891507/156410386-a874430c-f340-43ed-9c3a-92e8d4d50fc9.mov

### Link to DocType in Customize Form

The DocType names get translated before being searched. This is a preexisting hack in the framework for DocType and Role. In this case, we can search in the translations.

#### Before

https://user-images.githubusercontent.com/14891507/156414648-8e505f8c-9dee-4358-8182-3b358c28bb62.mov

#### After

https://user-images.githubusercontent.com/14891507/156411881-c4ca22e1-1397-4e13-9768-5e16b72f8d6d.mov

https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext/customize-form/edit?wiki_page_patch=fdafee2715
2022-05-16 13:21:42 +00:00
Ankush Menat
a9d6147999
fix(server_scripts): warn about restricted context (#16900)
Server script UX is bad when you don't know what's whitelisted and what isn't... this often requires executing-rewrite-execute cycle for trivial things.

So instead, on saving just compile server script and immediately give warnings for whatever that can be caught at compile time.
2022-05-16 13:34:25 +05:30
Ritwik Puri
968343b302
Merge branch 'develop' into autoinc-customize-form-fix 2022-05-13 00:41:58 +05:30
phot0n
f6dac70033 refactor(minor): convert change_name_type_and_make_sequence function to setup_autoincrement_and_sequence method
* chore(Customize Form): remove autoincrement naming option from autoname description

* chore: move sequence cache comment from schema.py to database.py

* chore: added docstrings to some functions
2022-05-13 00:03:19 +05:30
phot0n
b1d61906d1 test: update and rename test_change_autoname
* chore: remove unnecessary decorators for skiprun
2022-05-13 00:03:19 +05:30
gavin
04baffb1ab
Merge pull request #16885 from gavindsouza/show-all-role-warning
fix(ux): Show note on how 'All' Role impacts users
2022-05-12 18:05:56 +05:30
Chillar Anand
485988682d
refactor: Remove dead code (#16886) 2022-05-12 18:04:44 +05:30
phot0n
82aa8dee08 fix: don't allow autoincrement autoname from customize form
* test: test_change_autoname for doctype

* test: test_autoincrement_autoname for customize form
2022-05-12 15:18:02 +05:30
gavin
8a2c351cf1 fix(ux): Show note on how 'All' Role impacts users
In response to https://github.com/frappe/frappe/issues/16836
2022-05-12 13:29:57 +05:30
Ritwik Puri
7fa9c42711
Merge branch 'develop' into atom 2022-05-11 22:35:09 +05:30
chillaranand
d2b63d0935 feat: Added force flag to install-app command 2022-05-11 16:18:14 +05:30
Himanshu
d7b42e34fc
Merge branch 'develop' into disable_change_log 2022-05-09 16:44:30 +01:00
phot0n
de359bfedc chore: use set and get methods to set attributes
This lets us split the ddl things to on_update hook i.e post save
2022-05-05 21:31:14 +05:30
phot0n
3946a84cc3 fix: move change_name_type_and_make_sequence to validate method of Doctype 2022-05-05 21:31:14 +05:30
phot0n
2ba1b6a549 chore: better naming for setup_name_type_and_sequence 2022-05-05 21:31:14 +05:30
phot0n
cfc905b567 fix: use cast when chaninging name type from varchar to bigint in postgres 2022-05-05 21:31:13 +05:30
phot0n
9f0c40dbba fix: create sequence onchange from any other autoname whcih is not autoincrement
* chore: use class variable for determining sequence cache

* chore: use sql_ddl when creating sequence
2022-05-05 21:31:13 +05:30
Suraj Shetty
3ef6d6f20d
Merge branch 'develop' into develop 2022-05-05 18:59:26 +05:30
Suraj Shetty
2dfdb90e2d
Merge branch 'develop' into remove-is_first_startup 2022-05-05 18:45:27 +05:30
Raffael Meyer
dff8d92b69
Merge branch 'develop' into disable_change_log 2022-05-04 17:26:05 +02:00
Shariq Ansari
b4e43257c3
fix: bad query if user has ' in the email address (#16796) 2022-05-04 19:07:51 +05:30
Sagar Vora
a33c2e2abe
refactor(BaseDocument)!: improved get, set and extend methods (#16540)
* perf!: 80% faster doc.get for fields with `None` as value

* perf: quicker init child (#3)

* refactor: avoid repitition and improve error message

* test: `doc.extend`

* fix: improve constant naming

* fix: minor improvements and tests

* refactor: improve naming
2022-05-04 18:37:06 +05:30
Ankush Menat
d1938ee271
perf: remove naming series from log-like doctypes (#16823)
- webhook request log
- access log
2022-05-04 10:54:52 +05:30
phot0n
33b49b4d46 refactor(minor): remove is_first_startup from System Settings 2022-05-04 10:43:59 +05:30
rajkris
356c6b79aa fix: Merge branch 'develop' of github.com:RAJKRIS/frappe into develop 2022-05-02 21:38:28 +05:30
rajkris
48947796ce fix: fix linter issues 2022-05-02 21:38:07 +05:30
Himanshu
97c2721927
Merge branch 'develop' into disable_change_log 2022-05-01 18:54:29 +01:00
Ritwik Puri
b41379c78b
fix: misc fixes (integer primary keys) (#16307)
* fix: misc fixes

local.x gets resetted on every request so switched to a simple dict

simplified is_val_used in set_next_val function for sequences

* chore: use multisql for sequence methods

* fix: fields not updating on form

* minor(base_input): removed unnecessary branching in update_input

* chore: remove prints and rename autoincremented_status_map

* chore: added proper type hint + comment + formatting

* fix: added searching in cast_name rather than handling it manually

* fix: share condition query + test_build_match_conditions

* fix: add cast_name to more places

* test: test for sequence

* fix: sequence functions

* fix: inherit frappetestcase

* minor: attach sequence methods to db context local

* chore: update sequence function names in Database

use frappe.db for sequences in naming.py

* fix: convert filename to str (for autoincremented doctypes)

* chore: better regex for modifying values for postgres

* minor: allow changing name column type (if no data is present in the doctype)

* refactor: validate_autoname

converted it to a simple function
enabled changing autoincrement autoname from customize form

* fix: use sql_ddl for change_column_type in postgres

* fix: use not null constraint in postgres when changing name type

* fix(test): updated test_autoincremented_doctype_transition with transitioning when no data is present

* fix(test): updated test_cast_name

probably messed up during rebase

* fix(test): used rollback upon error in transaction for postgres

* chore: use frappe.db.x methods for sequences

* minor: use temporary sequences in test

* minor: use generate_hash for sequence naming in sequence tests

* chore: replace sequence imports with frappe.db.x

* chore: move out casting name fields to a separate method

* refactor: cast_name

more explicit cases for casts and added docstring

* fix: added space in test_cast_name

* chore: fix linter

* chore: better naming for can_change_name_column_type

* chore: add comment for autoincremented_site_status_map

* chore: update/add docstrings
2022-04-29 15:06:03 +05:30
Himanshu
e1f05c3b80
Merge branch 'develop' into disable_change_log 2022-04-28 13:39:29 +01:00
hrwx
63e2e328c6 feat: disable change log 2022-04-28 13:38:36 +01:00
gavin
f1cceba81b
Merge pull request #16763 from surajshetty3416/fix-autoname-validation
fix: Validate "autoname" for Customize Form
2022-04-28 15:03:39 +05:30
Suraj Shetty
ccc82e2c4c
Merge pull request #15538 from noahjacob/phone_field_control
feat: Phone Control Type
2022-04-28 10:27:52 +05:30
Suraj Shetty
2bc06a1058 fix: Check if autoname exists 2022-04-27 17:08:42 +05:30
Saurabh
834706e33b chore: add missing doc event type 2022-04-27 11:45:34 +05:30
RAJKRIS
412ed8e146
Merge branch 'develop' into develop 2022-04-27 10:37:01 +05:30
Saurabh
e2d3d1d0be
feat: provision to handle payment authorization event in server script for custom documents (#16712)
Currently, there is no provision to handle payment authorization events via server script. So it's not possible if a user wants to link payments against custom documents. 

Thus adding a provision in server script 
- Setup checkout for custom doc 
<img width="1299" alt="Screenshot 2022-03-11 at 2 44 19 PM" src="https://user-images.githubusercontent.com/3784093/157838010-989f6009-83d6-4329-92a6-bb2b6b38438b.png">

- Handle payment callback
<img width="1051" alt="Screenshot 2022-04-22 at 11 28 19 AM" src="https://user-images.githubusercontent.com/3784093/164612613-d321edb3-c7f8-4063-b809-8ae5fe46ee66.png">

## Documentation
https://frappeframework.com/docs/v13/user/en/desk/scripting/server-script/edit?wiki_page_patch=bbed0fcd9a
2022-04-26 10:02:30 +00:00
Ankush Menat
a245cb51a2
feat: configurable auto email reports limit (#16684)
- The previous limit was 3 per user which is way too less, no known reason to
restrict this other than hogging of system with too many reports. Bumped
default limit to 20.
- site config is not easily discoverable or editable, added config in
  system settings.
- Moved auto email report background job form daily queue to `daily_long` queue. 

closes https://github.com/frappe/frappe/issues/16681 


<img width="1049" alt="Screenshot 2022-04-20 at 12 33 06 PM" src="https://user-images.githubusercontent.com/9079960/164170117-5612d9df-da91-441b-a4f6-acd89d30336e.png">


`no-docs` (error message is sufficient to explain to user what to do without referring docs)


ref: 

ISS-21-22-10245
ISS-21-22-07742
ISS-20-21-10850
ISS-20-21-10112

and many more times. This is such a stupid validation 🤦
2022-04-22 08:02:31 +00:00
Rushabh Mehta
78bddb4127
Merge pull request #16653 from rmehta/error-log-ref
feat(minor): Add document reference to Error Log and doc.log_error
2022-04-20 15:54:59 +05:30
Ankush Menat
dcee40046a
perf!: simpler frappe.get_system_setting (#16685)
Not sure why this needs to be "cached" in locals again when db object
already caches it in value_cache.
2022-04-20 15:16:04 +05:30
Suraj Shetty
8f94cb655f
Merge branch 'develop' into phone_field_control 2022-04-19 16:28:18 +05:30
rajkris
a7a34eaad2 fix: linter errore 2022-04-19 12:49:10 +05:30
rajkris
682b3f818a fix: resolve conflict 2022-04-19 12:43:26 +05:30
phot0n
1aa267a519 chore: move the field to permission section
* chore: fix type in description of ignore_xss_filter in docfield doctype
2022-04-19 12:41:33 +05:30