8000 fix: grid row default values not using model by dj12djdjs · Pull Request #23701 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: grid row default values not using model #23701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

dj12djdjs
Copy link
Collaborator

Use case:
ERPNext update child items dialog. Note the default key

fields.splice(2, 0, {
			fieldtype: 'Date',
			fieldname: frm.doc.doctype == 'Sales Order' ? "delivery_date" : "schedule_date",
			in_list_view: 1,
			label: frm.doc.doctype == 'Sales Order' ? __("Delivery Date") : __("Reqd by date"),
			default: frm.doc.doctype == 'Sales Order' ? frm.doc.delivery_date : frm.doc.schedule_date,
			reqd: 1
		})

Preview:

grid.default.value.mp4

@dj12djdjs dj12djdjs requested review from a team and ankush and removed request for a team December 8, 2023 19:13
Copy link
stale bot commented Jan 3, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

@stale stale bot added the inactive label Jan 3, 2024
@stale stale bot closed this Jan 8, 2024
@dj12djdjs dj12djdjs reopened this Jan 8, 2024
@stale stale bot removed the inactive label Jan 8, 2024
Copy link
codecov bot commented Jan 8, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (91dce0b) 61.85% compared to head (bb73d77) 60.10%.
Report is 804 commits behind head on develop.

❗ Current head bb73d77 differs from pull request most recent head fb8507b. Consider uploading reports for the commit fb8507b to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #23701      +/-   ##
===========================================
- Coverage    61.85%   60.10%   -1.76%     
===========================================
  Files          774      775       +1     
  Lines        75760    79300    +3540     
  Branches      6346     6412      +66     
===========================================
+ Hits         46864    47663     +799     
- Misses       25278    27904    +2626     
- Partials      3618     3733     +115     
Flag Coverage Δ
server-ui 27.24% <ø> (-0.46%) ⬇️
ui-tests 50.72% <0.00%> (-1.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
stale bot commented Jan 25, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

@stale stale bot added the inactive label Jan 25, 2024
@stale stale bot closed this Jan 28, 2024
@dj12djdjs dj12djdjs reopened this Jan 29, 2024
@stale stale bot removed the inactive label Jan 29, 2024
Copy link
Collaborator
@barredterra barredterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested – apart from below nitpick this looks good to me

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
@barredterra barredterra added backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15 labels Feb 14, 2024
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
@barredterra barredterra merged commit f9b5d60 into frappe:develop Feb 14, 2024
ankush pushed a commit that referenced this pull request Feb 26, 2024
* fix: grid row default values with not using model

(cherry picked from commit bb73d77)

* fix: replace $.extend with spread operator

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit c2eff72)

* chore: correct linter failure

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit fb8507b)

---------

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
ankush pushed a commit that referenced this pull request Feb 26, 2024
* fix: grid row default values with not using model

(cherry picked from commit bb73d77)

* fix: replace $.extend with spread operator

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit c2eff72)

* chore: correct linter failure

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit fb8507b)

---------

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Feb 28, 2024
# [15.16.0](v15.15.0...v15.16.0) (2024-02-28)

### Bug Fixes

* **a11y:** Improve desk accessibility (backport [#23319](#23319)) ([#25023](#25023)) ([48665e6](48665e6))
* add context for row number label ([235f921](235f921))
* add show_dashboard field on custom fields ([#24984](#24984)) ([#24986](#24986)) ([34bca99](34bca99))
* added important to bold class. ([718973e](718973e))
* allow negative numbers in grid search ([#24989](#24989)) ([#24991](#24991)) ([e778fe9](e778fe9))
* Avoid add "null" to cc in communication in timeline (backport [#25092](#25092)) ([#25096](#25096)) ([06c7a87](06c7a87))
* Cast to string to handle int PK ([#24988](#24988)) ([#24993](#24993)) ([de3042b](de3042b))
* Check perm for library file before cloning ([#25117](#25117)) ([#25120](#25120)) ([173ff30](173ff30))
* **ControlTime:** Don't set datepicker's date if field is read only ([#25038](#25038)) ([#25076](#25076)) ([3e33ae3](3e33ae3))
* Correct type hint ([#24990](#24990)) ([#24995](#24995)) ([3f956c1](3f956c1))
* disable internal columns like _comments from report column selec… ([#24998](#24998)) ([#25000](#25000)) ([76a32f2](76a32f2))
* Don't init site if already init-ed during truncate ([#25033](#25033)) ([#25036](#25036)) ([5ddbfb2](5ddbfb2))
* **File Uploader:** call 'upload_files' without passing event object ([#25034](#25034)) ([#25087](#25087)) ([ce5abfc](ce5abfc))
* force `[]` as default for child tables ([#24000](#24000)) ([fea1623](fea1623))
* **formatters:** Translate Select value in format_value ([#24951](#24951)) ([#25077](#25077)) ([ff9e199](ff9e199))
* german translation of No. ([4e491b2](4e491b2))
* grid row default values not using model (backport [#23701](#23701)) ([#24896](#24896)) ([ad05acb](ad05acb))
* **grid:** Add type attribute to buttons ([#25021](#25021)) ([#25022](#25022)) ([d440fef](d440fef))
* Guess currency from report row if available ([#25009](#25009)) ([#25010](#25010)) ([dfcee61](dfcee61))
* handle total rows in number card ([#25011](#25011)) ([#25012](#25012)) ([4882bfc](4882bfc))
* invalid lru_cache usage ([#25046](#25046)) ([#25047](#25047)) ([e275851](e275851))
* **module_map:** only include apps installed on the site - not everything on the bench (backport [#24688](#24688)) ([#25122](#25122)) ([79e7c57](79e7c57))
* Private images in PDFs from background jobs ([#24980](#24980)) ([#25015](#25015)) ([3211ccf](3211ccf))
* replaced created by with owner in base_document ([#25059](#25059)) ([#25061](#25061)) ([bc5d09d](bc5d09d))
* restrict method for security critical endpoints ([#25105](#25105)) ([#25108](#25108)) ([44f4858](44f4858))
* ruff fixes ([c557ec6](c557ec6))
* show tooltip on edit table row (backport [#25040](#25040)) ([#25069](#25069)) ([2afbed7](2afbed7))
* spelling of "recording" in button (backport [#25025](#25025)) ([#25026](#25026)) ([6bf4f1c](6bf4f1c))
* support running QB union queries (backport [#24757](#24757)) ([#25016](#25016)) ([c092efa](c092efa))
* translate doctype in user-facing error message ([#25045](#25045)) ([3cd1eb2](3cd1eb2))
* validate fetch from ([#25116](#25116)) ([#25118](#25118)) ([624985d](624985d))
* wrap read_only functions correctly ([#25018](#25018)) ([#25020](#25020)) ([88a09be](88a09be))

### Features

* add push notification ([93ecd40](93ecd40))
* hook for print format template loader ([#25037](#25037)) ([#25074](#25074)) ([201e30f](201e30f))
* Impersonate a user (backport [#25050](#25050)) ([#25051](#25051)) ([813fb59](813fb59))
* socketio using authorization headers (backport [#24858](#24858)) ([#24966](#24966)) ([2045340](2045340))
* support array request type ([#25109](#25109)) ([#25112](#25112)) ([957d3eb](957d3eb))

### Performance Improvements

* avoid unnecessary json parsing ([#25065](#25065)) ([#25073](#25073)) ([1b814b3](1b814b3))
* don't process checks if there are none ([#25063](#25063)) ([#25071](#25071)) ([c3b0931](c3b0931))
* remove specific elements instead of re-rendering entire list ([#25078](#25078)) ([#25089](#25089)) ([37c9d3f](37c9d3f))
frappe-pr-bot pushed a commit that referenced this pull request Feb 28, 2024
## [14.66.3](v14.66.2...v14.66.3) (2024-02-28)

### Bug Fixes

* add context for row number label ([b9bb4e3](b9bb4e3))
* Avoid add "null" to cc in communication in timeline (backport [#25092](#25092)) ([#25095](#25095)) ([4bb84e7](4bb84e7))
* Cast to string to handle int PK ([#24988](#24988)) ([#24992](#24992)) ([4b7edff](4b7edff))
* Check perm for library file before cloning ([#25117](#25117)) ([#25119](#25119)) ([3b75844](3b75844))
* **ControlTime:** Don't set datepicker's date if field is read only ([#25038](#25038)) ([#25075](#25075)) ([b0d55a3](b0d55a3))
* disable internal columns like _comments from report column selec… ([#24998](#24998)) ([#24999](#24999)) ([78ff82b](78ff82b))
* Don't init site if already init-ed during truncate ([#25033](#25033)) ([#25035](#25035)) ([52bb028](52bb028))
* **File Uploader:** call 'upload_files' without passing event object ([#25034](#25034)) ([#25086](#25086)) ([40b725d](40b725d))
* german translation of No. ([ac841dc](ac841dc))
* grid row default values not using model (backport [#23701](#23701)) ([#24895](#24895)) ([119d7a6](119d7a6))
* invalid lru_cache usage ([#25046](#25046)) ([#25048](#25048)) ([f9d4874](f9d4874))
* replaced created by with owner in base_document (backport [#25059](#25059)) ([#25060](#25060)) ([ceb81a0](ceb81a0))
* set default user value only if enabled ([#25017](#25017)) ([deeb509](deeb509))
* show tooltip on edit table row (backport [#25040](#25040)) ([#25068](#25068)) ([4fb20ff](4fb20ff))
* translate doctype in user-facing error message (backport [#25043](#25043)) ([#25044](#25044)) ([d3054e4](d3054e4))
* wrap read_only functions correctly ([#25018](#25018)) ([#25019](#25019)) ([81af784](81af784))

### Performance Improvements

* avoid unnecessary json parsing ([#25065](#25065)) ([#25072](#25072)) ([ae469ef](ae469ef))
* remove specific elements instead of re-rendering entire list ([#25078](#25078)) ([#25088](#25088)) ([e6c1269](e6c1269))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0