Assume a book with configured read-only threshold (File->Properties->Accounts) and a date older than the threshold was just entered in a date cell. Now depending on how you leave the cell the user may or may not get a warning that the date is being reset to the day right after the threshold. When leaving with mouse click, tab, arrow up or arrow down the warning is displayed. When leaving with enter or return the warning isn't displayed. Note in all cases the date is reset. This bug is about the warning not being displayed consistently.
Partly see comment on Bug 796812. Looks like I had missed the use of the gdate form in the function gnc_split_register_save_date_cell in file split-register-model-save.c To fix this one could change this function to use the other form like... SRSaveData *sd = save_data; const char *value; time64 cell_time; g_return_if_fail (gnc_basic_cell_has_name (cell, DATE_CELL)); value = gnc_basic_cell_get_value (cell); DEBUG ("DATE: %s", value ? value : "(null)"); gnc_date_cell_get_date ((DateCell *) cell, &cell_time); /* commit any pending changes */ gnc_date_cell_commit ((DateCell *) cell); xaccTransSetDatePostedSecsNormalized (sd->trans, cell_time); Note the commit after call to gnc_date_cell_get_date. A similar change can also be made to the equivalent function in gncEntryLedgerModel as below... BasicCell *cell; time64 cell_time; cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_DATE_CELL); gnc_date_cell_get_date ((DateCell *) cell, &cell_time); /* commit any pending changes */ gnc_date_cell_commit ((DateCell *) cell); gncEntrySetDate (entry, time64CanonicalDayTime(cell_time)); Note the use of time64CanonicalDayTime to change time to midday.
Ok that looks reasonable. Add my suggestions in bug 796812 to eliminate the gdate form completely and add a boolean warn parameter to gnc_date_cell_get_date.
Fix hopefully in PR400 along the above lines.
Merged for 3.3.