Skip to content
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

[FIX] pivot: handle boolean-like function arguments in `getPivotCellF… #5288

Closed
wants to merge 1 commit into from

Conversation

rrahir
Copy link
Collaborator

@rrahir rrahir commented Dec 2, 2024

…romPosition`

The getter would only detect the 'includeTotal' and 'includeColumnHeaders' arguments if they were explicitely written as boolean and not as boolean-like (i.e; 1,2, 0, -1) values.

Task: 4207502

Description:

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

Task: 4207502

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

@robodoo
Copy link
Collaborator

robodoo commented Dec 2, 2024

Pull request status dashboard

@@ -204,11 +206,14 @@ export class PivotUIPlugin extends UIPlugin {
return EMPTY_PIVOT_CELL;
}
if (functionName === "PIVOT") {
const includeTotal = args[2] === false ? false : undefined;
const includeColumnHeaders = args[3] === false ? false : undefined;
const includeTotal = isMatrix(args[2]) ? args[2][0][0] : args[2];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const includeTotal = isMatrix(args[2]) ? args[2][0][0] : args[2];
const includeTotal = toScalar(args[2]);

const includeColumnHeaders = args[3] === false ? false : undefined;
const includeTotal = isMatrix(args[2]) ? args[2][0][0] : args[2];
const shouldIncludeTotal = includeTotal === undefined ? true : toBoolean(includeTotal);
const includeColumnHeaders = isMatrix(args[3]) ? args[3][0][0] : args[3];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const includeColumnHeaders = isMatrix(args[3]) ? args[3][0][0] : args[3];
const includeColumnHeaders = toScalar(args[3]);

…romPosition`

The getter would only detect the 'includeTotal' and
'includeColumnHeaders' arguments if they were explicitely written as
boolean and not as boolean-like (i.e; 1,2, 0, -1) values.

Task: 4207502
@rrahir rrahir force-pushed the saas-17.4-fix-pivot-arg-parsing-rar branch from 5c49527 to 36b50ff Compare December 2, 2024 10:40
Copy link
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

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

robodoo r+

robodoo pushed a commit that referenced this pull request Dec 2, 2024
…romPosition`

The getter would only detect the 'includeTotal' and
'includeColumnHeaders' arguments if they were explicitely written as
boolean and not as boolean-like (i.e; 1,2, 0, -1) values.

closes #5288

Task: 4207502
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
@robodoo robodoo closed this Dec 2, 2024
@fw-bot fw-bot deleted the saas-17.4-fix-pivot-arg-parsing-rar branch December 16, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants