Skip to content

[18.0] mis_builder: add checks for P&L and balance sheet#785

Open
alexis-via wants to merge 2 commits intoOCA:18.0from
akretion:18.0-pl-consistency-check-final
Open

[18.0] mis_builder: add checks for P&L and balance sheet#785
alexis-via wants to merge 2 commits intoOCA:18.0from
akretion:18.0-pl-consistency-check-final

Conversation

@alexis-via
Copy link
Copy Markdown
Contributor

This PR adds an optional selection field on mis.report with 2 possible values:

  1. P&L
  2. Balance Sheet

If this optional selection field is set to P&L, it will check that only balp is used and that each income & expense account is used exactly once and that no other account is used
If the optional selection field is set to Balance sheet, it will check that only bale/pbale/nbale are used, that each account (unless off_balance and equity_unaffected) is used once for bale, or once in pbale AND once is nbale.

Questions on this PR:

Where should we plug the constraint checks on mis.report.instance ?
At the moment, it is called when you click on the buttons "Preview" or "Print" or "Export". But it is not called when the report is in the dashboard. Which method should we inherit to perform checks in all circumstances ?

In v18, the display_name of an account depends on the company of the context. I use the display_name of accounts in error messages, but a MIS report template can apply to several companies. At the moment, I use the display_name of the first company of the MIS report template.

We could adds checks for the signs in the formula (cf TODO in comments).

sbidoul and others added 2 commits April 3, 2026 10:42
New field constraint_type on mis.report.
If field 'constraint_type' is set, Odoo will check the MIS report template before
displaying the report to the user.
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

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