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

[IMP] chart: support import/export of dataset trendlines #5318

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Rachico
Copy link
Contributor

@Rachico Rachico commented Dec 5, 2024

This commit introduces the ability to import and export trendlines associated with datasets in chart configurations.

Task: 4319957

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 5, 2024

Pull request status dashboard

@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch 3 times, most recently from 2d5c4c7 to 83539de Compare December 5, 2024 13:38
@Rachico Rachico requested a review from anhe-odoo December 6, 2024 09:10
@Rachico Rachico marked this pull request as ready for review December 6, 2024 09:10
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch from 83539de to ec88721 Compare December 6, 2024 09:36
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch 3 times, most recently from 5dec1f9 to 4db8ba5 Compare December 11, 2024 10:33
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch 7 times, most recently from 25e3cc0 to 133cff2 Compare December 19, 2024 16:56
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch 4 times, most recently from e9ca1fb to cbb4df1 Compare December 23, 2024 15:39
@Rachico Rachico requested a review from anhe-odoo December 23, 2024 15:39
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch from cbb4df1 to 9a39663 Compare December 24, 2024 11:34
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch from 9a39663 to 4c37821 Compare January 2, 2025 09:35
Copy link
Collaborator

@pro-odoo pro-odoo left a comment

Choose a reason for hiding this comment

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

Conflict :/

@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch 2 times, most recently from 4273c54 to 40545cb Compare February 25, 2025 11:47
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch 3 times, most recently from f6175f0 to 325bfcd Compare March 19, 2025 16:09
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

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

👋

@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch 21 times, most recently from f2a104f to 9889b9b Compare March 27, 2025 11:19
Rachico added 2 commits March 27, 2025 12:19
Prior to this commit, when adding a moving average trendline, the
window value is not saved unless a click away event is triggered.
This commit fixes this issue by initializing the moving average
window value when the user selects it from the side pandel.

Task: 0
This commit introduces the ability to import and export trendlines
associated with datasets in chart configurations.

Task: 4319957
@Rachico Rachico force-pushed the master-import-export-trendlines-mera branch from 9889b9b to 7f8f509 Compare March 27, 2025 11:20
@Rachico
Copy link
Contributor Author

Rachico commented Mar 27, 2025

@hokolomopo It should be good now

Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

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

👋

case "trailingMovingAverage":
config = {
type,
window: this.defaultWindowSize,
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah it's now on a separate commit, but it doens't really address the issue. window is still typed as possibly undefined in a trendline. Either 1) it should be required, typed as such and we should do a migration to ensure it's always defined or 2) your code should also work when window is undefined, and defaults to DEFAULT_WINDOW_SIZE size.

  1. sounds way better

const attrs: XMLAttributes = [
[
"val",
trend.color ? toXlsxHexColor(trend.color).slice(0, 6) : getTrendlineColor(dataSetColor),
Copy link
Contributor

Choose a reason for hiding this comment

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

toXlsxHexColor(trend.color).slice(0, 6) is wrong, xlsx color have the alpha as the first two digits (AARRGGBB). You will slice the blue channel instead of the alpha channel here.

Comment on lines +800 to +803
{
dataRange: "Sheet1!B27:B35",
backgroundColor: "#1F77B4",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

useless change

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.

6 participants