o-spreadsheet icon indicating copy to clipboard operation
o-spreadsheet copied to clipboard

[FIX] spreadsheet: handle inverse increment when autofilling upwards/left

Open Rachico opened this issue 10 months ago • 1 comments

Prior to this commit, autofilling upwards or to the left only correctly inverted the increment for numbers, but not when given a group of cells. This led to incorrect results when autofilling mixed content.

The issue occurred because the rule generator always processed values in the same order, regardless of the autofill direction. When a single numeric value was present in a group of cells, the autofill logic failed to apply a negative increment when filling upwards.

To address this, the rule generator now considers the autofill direction.

Steps to reproduce:

  1. Insert the following values in a column:
    • A10: 'test'
    • A11: 'test2'
    • A12: '4'
  2. Select A10:A12 and autofill upwards.
  3. Expected: A9 should be '3'. Before this fix, it incorrectly showed '5'.

Task: 4199568

review checklist

  • [ ] feature is organized in plugin, or UI components
  • [ ] support of duplicate sheet (deep copy)
  • [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • [ ] in model/UI: ranges are strings (to show the user)
  • [ ] undo-able commands (uses this.history.update)
  • [ ] multiuser-able commands (has inverse commands and transformations where needed)
  • [ ] new/updated/removed commands are documented
  • [ ] exportable in excel
  • [ ] translations (_t("qmsdf %s", abc))
  • [ ] unit tested
  • [ ] clean commented code
  • [ ] track breaking changes
  • [ ] doc is rebuild (npm run doc)
  • [ ] status is correct in Odoo

Rachico avatar Feb 10 '25 13:02 Rachico

Pull request status dashboard

robodoo avatar Feb 10 '25 13:02 robodoo