Skip to content

[19.0][FIX] kpi: history name default evaluated when the server starts - #1241

Open
parabol123654 wants to merge 1 commit into
OCA:19.0from
parabol123654:19.0-fw-kpi-history-name
Open

parabol123654 wants to merge 1 commit into
OCA:19.0from
parabol123654:19.0-fw-kpi-history-name

Conversation

@parabol123654

@parabol123654 parabol123654 commented Nov 13, 2026 •

Copy link
Copy Markdown

Forward port of #1229 (merged in 18.0).

The name of kpi.history had default=fields.Datetime.now(), evaluated once when the module is imported, so every history line computed afterwards was named after the time the server started. 19.0 has the same code; the default is now a lambda.

Test test_kpi_history_name: fails without the fix ('2026-11-13 16:33:11' != '2030-02-15 08:00:00'), and the 19 tests of kpi pass with it.

Assisted-by: Claude Opus 5.5

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @max3903,
some modules you are maintaining are being modified, check this out!

@max3903 max3903 added this to the 19.0 milestone Nov 13, 2026
@max3903 max3903 self-assigned this Nov 13, 2026
@max3903
max3903 self-requested a review November 13, 2026 17:10

@max3903 max3903 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, LGTM.

fields.Datetime.now() was called when the module was imported, so every
KPI history line got the time the Odoo server was started as its name.

Assisted-by: Claude Opus 5.5
@parabol123654
parabol123654 force-pushed the 19.0-fw-kpi-history-name branch from a34a92a to 83f42ef Compare November 14, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants