Commit graph

589 commits

Author SHA1 Message Date
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Raffael Meyer
a7633738ea
Merge branch 'develop' into merge_translated_doctypes 2022-08-13 14:03:32 +02:00
Sagar Vora
e3d581afdf fix: dont mutate df when creating custom fields 2022-08-13 12:57:03 +05:30
Himanshu
85467b3e96
Merge branch 'develop' into merge_translated_doctypes 2022-08-09 15:16:49 +01:00
Gavin D'souza
624c308659 Merge branch 'develop' of github.com:frappe/frappe into modules-refactor 2022-08-08 12:27:11 +05:30
hrwx
b01929405d refactor: translatable doctypes 2022-08-05 21:38:10 +01:00
Ankush Menat
40f27f908a style: format JS files with prettier 2022-08-04 14:51:01 +05:30
Gavin D'souza
3863d9bb80 fix(global_search): Trigger rebuilding on Custom Field's property change 2022-08-02 14:49:04 +05:30
Ankush Menat
b8d56eaefb chore: remove test doctypes from prod 2022-07-22 14:25:49 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Ankush Menat
6dfbf7b19e fix: show doctype and fieldname filters 2022-06-13 16:42:37 +05:30
Ankush Menat
359c7768f5 fix: multiple postgres transaction abort issues
- wrap setup fixtures in savepoint
- wrap scheduled_job_type in savepoint
- ignore duplicates where it's ignored by exc
- dont attempt to delete from deleted table
- delete custom field and commit - stale meta causes future inserts to
  insert unknown field.
2022-06-05 00:26:15 +05:30
chillaranand
25f82e966c refactor: Remove unused imports & code 2022-05-19 15:34:35 +05:30
chillaranand
1d763a6659 refactor: Fix flake8 issues 2022-05-19 15:34:35 +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
phot0n
f14fb2326d test(customize form): rename test_autoincrement_autoname to test_change_to_autoincrement_autoname 2022-05-13 00:09:51 +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
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
phot0n
edce9a1865 Revert "fix: allow setting autoincrement autoname from customize form"
This reverts commit d43d9594f0ed6f6d88466879bc36a5c5bca24b77.
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
87916060c9 test: change autoname from customize form 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
phot0n
646d2271b8 fix: allow setting autoincrement autoname from customize form
* chore: updated the warning under autoincrement autoname
2022-05-05 21:31:13 +05:30
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
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
30440026db fix: Do not allow autoname changes to/from autoincrement in customize form 2022-04-28 11:44:33 +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
9422a4fc88 fix: Add naming_rule to retain changes from Customize Form 2022-04-27 10:25:47 +05:30
Suraj Shetty
8f94cb655f
Merge branch 'develop' into phone_field_control 2022-04-19 16:28:18 +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
phot0n
bb58ee5ee6 feat(minor): add ignore_xss_filter to customize form field 2022-04-19 12:37:09 +05:30
Suraj Shetty
8cd372d90b refactor: Commonify autoname validation
- Validate autoname for Customize Form
2022-04-18 11:08:07 +05:30
mergify[bot]
6890f83324
Merge pull request #16591 from netchampfaris/allow-multiple-client-scripts
feat: allow multiple client scripts
2022-04-14 12:48:18 +00:00
Suraj Shetty
6b7fda495b Merge branch 'develop' of https://github.com/frappe/frappe into phone_field_control 2022-04-14 14:19:35 +05:30
Gavin D'souza
bfc1b36f18 Merge branch 'reload-doc_force' into modules-refactor 2022-04-14 13:32:20 +05:30
Gavin D'souza
67478e25c3 fix: Drop dead suspicious looking API 2022-04-14 13:29:44 +05:30
Gavin D'souza
6538419e5d fix: Add return values to enable better testing ;) 2022-04-14 13:29:20 +05:30
Gavin D'souza
5564f1e007 fix: Allow adding JSON fields via Customize Form 2022-04-14 09:52:26 +05:30
Faris Ansari
32e4f932bb test: ui test for client scripts 2022-04-14 00:17:26 +05:30
Noah Jacob
c2f2fc10e7 Merge branch develop into phone_field_control 2022-04-12 20:40:29 +05:30
Faris Ansari
5fb2bfab4b feat: allow multiple client scripts 2022-04-12 13:22:32 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Noah Jacob
bf92b363e2
Merge branch 'develop' into phone_field_control 2022-04-07 15:04:47 +05:30
Shariq Ansari
0013f363e5
Merge branch 'develop' into customize-form-highlighted-rows-fix 2022-04-01 14:33:01 +05:30
Shariq Ansari
874b6d3ab9 fix: made is_system_generated hidden in customize form field doctype 2022-03-31 12:06:10 +05:30
Shariq Ansari
45e2361dcc fix(linter): Trim Trailing Whitespace 2022-03-31 11:58:50 +05:30
Shariq Ansari
1fdfbeb083 fix: added is_system_generated field in customize form field doctype 2022-03-31 11:56:35 +05:30
Sagar Vora
d1ee3005c2 perf: improve Custom Field insertion time 2022-03-30 06:57:48 +05:30
Shariq Ansari
36a69f9e0d fix: Remove row highlight code from setup_sortable method 2022-03-24 11:56:29 +05:30
Shariq Ansari
eadf6acab9
Merge branch 'develop' into customize-form-highlighted-rows-fix 2022-03-23 17:36:59 +05:30