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
Master pivot spreadsheet pro rar #4025
Conversation
This PR targets the un-managed branch odoo/o-spreadsheet:master-pivot-pro, it needs to be retargeted before it can be merged. |
d7ddf84
to
496a4ff
Compare
b1111ce
to
09b5336
Compare
96f8c40
to
ce7f6cc
Compare
ce7f6cc
to
96f8c40
Compare
0fbcc09
to
ebed644
Compare
09b5336
to
2a66ef5
Compare
ba74163
to
ece61d6
Compare
93d4704
to
2738e8c
Compare
ac0f715
to
57929ae
Compare
d2f4d98
to
575f647
Compare
543266b
to
a973988
Compare
575f647
to
8d93ee8
Compare
0af1b10
to
248d623
Compare
src/helpers/pivot/spreadsheet_pivot/data_entry_spreadsheet_pivot.ts
Outdated
Show resolved
Hide resolved
src/helpers/pivot/spreadsheet_pivot/data_entry_spreadsheet_pivot.ts
Outdated
Show resolved
Hide resolved
const orderedKeys = orderDataEntriesKeys(groups, row); | ||
const spTableRows: SPTableRow[] = []; | ||
for (const value of orderedKeys) { | ||
const _fields = fields.concat(rowName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be moved outside of the loop (probably push rowName into fields)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably push rowName into fields
No, fields should not be updated. (Hate recursive functions)
src/helpers/pivot/spreadsheet_pivot/data_entry_spreadsheet_pivot.ts
Outdated
Show resolved
Hide resolved
src/helpers/pivot/spreadsheet_pivot/data_entry_spreadsheet_pivot.ts
Outdated
Show resolved
Hide resolved
src/helpers/pivot/spreadsheet_pivot/data_entry_spreadsheet_pivot.ts
Outdated
Show resolved
Hide resolved
src/helpers/pivot/spreadsheet_pivot/data_entry_spreadsheet_pivot.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and done! thanks for this fantastic work. We are almost there :)
src/helpers/pivot/spreadsheet_pivot/data_entry_spreadsheet_pivot.ts
Outdated
Show resolved
Hide resolved
private getPivotCore(pivotId: UID): Pivot { | ||
const pivot = this.pivots[pivotId]; | ||
if (!pivot) { | ||
throw new Error(`Pivot with id ${pivotId} not found`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should we do with this error? review the revision log and fix it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not happen, if it happens, it's a bug and we will have to find the cause to fix it, that could be revision log, but not only
d97fa2b
to
0cc9d97
Compare
232c115
to
fea92ab
Compare
This commit is a step to introduce the spreadsheet pivot. The function COUNTUNIQUE is used in the pivot table to count the unique values in a range. The helper function is created to avoid code duplication. Task: 3748717 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
This commit is a step to introduce the spreadsheet pivot. The functions AND and OR are used in the pivot to compute the values when the measure is a boolean. Task: 3748717 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
With this commit, the function to compute the title of the side panel can now takes props as argument. This is useful to compute the title based on the props of the component. Task: 3748717 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
fea92ab
to
67d276d
Compare
This commit introduces the spreadsheet pivot table. It is a new type of pivot table that is based on values from the spreadsheet itself. The pivot table is created by selecting a range of cells in the spreadsheet. The first row of the range is used as the available fields, and the rest of the range is used as the data. The type of the data is automatically detected based on the content of the cells in the column. It could be `date` if all the cells in the column are dates, `boolean` if all the cells are boolean, `number` if all the cells are numbers, or `char` otherwise. Each field can be used as a dimension (row or column) or as a measure (value), based on its type. The user can drag and drop the fields to the corresponding area in the pivot table side panel, select the order, select the granularity if the field is a date. Each measure can be aggregated using different functions (sum, average, count, etc.). For now, the pivot table is updated in real-time when the user changes the range of cells in the spreadsheet. This could be heavy for large spreadsheets, but a flag will be implemented to delay the update in a future task (3897841). This commit is a first version of the pivot table. Features are missing compared to the pivot table implemented in Odoo, for example the possibility to use `PIVOT.HEADER` and `PIVOT.VALUE` functions (and all the features that come with it, autocompletion of formulas, positional arguments, etc.). This will be implemented in a future task (3897857). Task: 3748717 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
For now, the spreadsheet pivot does not fully support PIVOT.VALUE and PIVOT.HEADER functions, so we prefer to disable it. It will be reactivate later. List of features that are not supported: - Normalization of arguments, especially with the dates - Positional arguments (with #) Task: 3748717
67d276d
to
4e7eff0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robodoo r+ rebase-ff ça a l'air bien :)
Merge method set to rebase and fast-forward. |
This commit is a step to introduce the spreadsheet pivot. The function COUNTUNIQUE is used in the pivot table to count the unique values in a range. The helper function is created to avoid code duplication. Task: 3748717 Part-of: #4025 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
This commit is a step to introduce the spreadsheet pivot. The functions AND and OR are used in the pivot to compute the values when the measure is a boolean. Task: 3748717 Part-of: #4025 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
With this commit, the function to compute the title of the side panel can now takes props as argument. This is useful to compute the title based on the props of the component. Task: 3748717 Part-of: #4025 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
This commit introduces the spreadsheet pivot table. It is a new type of pivot table that is based on values from the spreadsheet itself. The pivot table is created by selecting a range of cells in the spreadsheet. The first row of the range is used as the available fields, and the rest of the range is used as the data. The type of the data is automatically detected based on the content of the cells in the column. It could be `date` if all the cells in the column are dates, `boolean` if all the cells are boolean, `number` if all the cells are numbers, or `char` otherwise. Each field can be used as a dimension (row or column) or as a measure (value), based on its type. The user can drag and drop the fields to the corresponding area in the pivot table side panel, select the order, select the granularity if the field is a date. Each measure can be aggregated using different functions (sum, average, count, etc.). For now, the pivot table is updated in real-time when the user changes the range of cells in the spreadsheet. This could be heavy for large spreadsheets, but a flag will be implemented to delay the update in a future task (3897841). This commit is a first version of the pivot table. Features are missing compared to the pivot table implemented in Odoo, for example the possibility to use `PIVOT.HEADER` and `PIVOT.VALUE` functions (and all the features that come with it, autocompletion of formulas, positional arguments, etc.). This will be implemented in a future task (3897857). Task: 3748717 Part-of: #4025 Co-authored-by: rrahir <rar@odoo.com> Co-authored-by: Pierre Rousseau <pro@odoo.com>
For now, the spreadsheet pivot does not fully support PIVOT.VALUE and PIVOT.HEADER functions, so we prefer to disable it. It will be reactivate later. List of features that are not supported: - Normalization of arguments, especially with the dates - Positional arguments (with #) closes #4025 Task: 3748717 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Description:
description of this task, what is implemented and why it is implemented that way.
Task: : TASK_ID
review checklist