Skip to content

[18.0][FIX] payroll: contribution register wizard dates evaluated when the server starts - #322

Open
parabol123654 wants to merge 1 commit into
OCA:18.0from
parabol123654:18.0-fix-payroll-contribution-register-dates
Open

parabol123654 wants to merge 1 commit into
OCA:18.0from
parabol123654:18.0-fix-payroll-contribution-register-dates

Conversation

@parabol123654

@parabol123654 parabol123654 commented Oct 31, 2026 •

Copy link
Copy Markdown

The defaults of date_from and date_to on payslip.lines.contribution.register (PaySlip Lines by Contribution Register wizard) are computed with datetime.now() when the module is imported. If the server was started in October and the report is printed in November, the wizard still proposes October 1st to October 31st.

The fix computes the defaults when the wizard is opened: the first and last day of the current month, using fields.Date.context_today.

The new test opens the wizard inside freeze_time("2030-02-15"). Without the fix it fails with FakeDate(2026, 10, 1) != FakeDate(2030, 2, 1). 19.0 has the same code; I will forward-port it after merge.

Assisted-by: Claude Opus 5.5

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

…server starts

The default dates were computed when the module was imported, so the
wizard proposed the month the Odoo server was started.

Assisted-by: Claude Opus 5.5
@parabol123654
parabol123654 force-pushed the 18.0-fix-payroll-contribution-register-dates branch from fd02b7e to e314a2e Compare November 14, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants