Merge pull request #33309 from sokumon/date-datetime-recursion

fix: dont trigger change when date/datetime is on grid
This commit is contained in:
Soham Kulkarni 2025-07-14 18:25:34 +05:30 committed by GitHub
commit e7066ea90b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,6 @@
frappe.ui.form.ControlDate = class ControlDate extends frappe.ui.form.ControlData {
static trigger_change_on_input_event = false;
on_grid = false;
make_input() {
super.make_input();
this.make_picker();
@ -68,7 +69,9 @@ frappe.ui.form.ControlDate = class ControlDate extends frappe.ui.form.ControlDat
maxDate: this.df.max_date,
firstDay: frappe.datetime.get_first_day_of_the_week_index(),
onSelect: () => {
this.$input.trigger("change");
if (!this.on_grid) {
this.$input.trigger("change");
}
},
onShow: () => {
this.datepicker.$datepicker

View file

@ -1,4 +1,5 @@
frappe.ui.form.ControlDatetime = class ControlDatetime extends frappe.ui.form.ControlDate {
on_grid = false;
set_formatted_input(value) {
if (this.timepicker_only) return;
if (!this.datepicker) return;

View file

@ -1163,7 +1163,7 @@ export default class GridRow {
grid_row: this,
value: this.doc[df.fieldname],
});
field.on_grid = true;
// sync get_query
field.get_query = this.grid.get_field(df.fieldname).get_query;
// df.onchange is common for all rows in grid