odoo/o-spreadsheet#4500

Created by fw-bot
Merged at 17ba4e52fbf92283b3516e6258cccfe90e190a55

Statuses:

label
odoo:master-saas-17.3-default-granularity-pro-EFtz-fw
head
602fcb13905ee08fa0492d09650ae7c1c6dbfa6a
merged
4 months ago by BI, Pierre Rousseau (pro)
odoo/o-spreadsheet
saas-17.3 #4499
master #4500

[FW][FIX] pivot: do not allow date dimension without granularity

When a date dimension is used in a pivot view, the granularity must be specified. Before this commit, it automatically defaulted to 'month_number'. With the experience of the odoo pivot, it's not a good idea to have a default granularity, as it's not easily migrable. In addition, supported a date dimension without granularity leads to lots of "if-else" in the code to handle this.

So, we prefer to avoid this situation and raise an error when a date dimension is used without a granularity.

Description:

description of this task, what is implemented and why it is implemented that way.

Task: : TASK_ID

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

Forward-Port-Of: #4499


  1. 8852ff2767eef111807a3f6efc7cc5376656f45f ↩↩↩↩↩↩↩↩↩↩

  2. https://github.com/odoo/odoo/blob/8346b2a7561c178fd7e9f9d1fbd7dac3e3843fd1/addons/account/models/account_move.py#L896-L912 ↩↩↩↩

  3. https://docs.python.org/3/library/logging.handlers.html#logging.StreamHandler ↩