Aangepaste rapporten¶
Odoo comes with a powerful and easy-to-use reporting framework. The engine allows you to create new reports, such as tax reports, or balance sheets and income statements with specific groupings and layouts.
Belangrijk
Activate the developer mode to access the accounting report creation interface.
To create a new report, open the Accounting app and navigate to . From here, you can either create a root report or a variant.
Basisrapporten¶
Basisrapporten kunnen worden beschouwd als generieke, neutrale boekhoudkundige rapporten. Ze dienen als modellen waarop lokale boekhoudkundige versies zijn gebaseerd. Als een rapport geen basisrapport heeft, wordt het zelf als basisrapport beschouwd.
Example
Een btw-rapport voor België en de VS zou beide dezelfde generieke versie als basis gebruiken en deze aanpassen aan hun binnenlandse regelgeving.
When creating a new root report, you need to create a menu item for it. To do so, open the report and, on that same report, click the (Actions) icon, then select Create Menu Item. Refresh the page; the report is now available under .
Notitie
Gevallen waarin je een nieuw basisrapport moet maken zijn zeldzaam, zoals wanneer de belastingautoriteiten van een land een nieuw en specifiek type rapport vereisen.
Varianten¶
Varianten zijn landspecifieke versies van basisrapporten en verwijzen daarom altijd naar een basisrapport. Om een variant te maken, selecteer je een generiek (basis)rapport in het veld Basisrapport bij het aanmaken van een nieuw rapport.
When a root report is opened from one of the accounting app’s main menus, all its variants are displayed in the variant selector in the top right corner of the view.
Example
In the following image, VAT Report (BE) is the variant of the root Generic Tax report.
Report lines¶
After having created a report (either root or variant), you need to fill it with report lines. You can either create a new one by clicking on Add a line, or modify an existing report line by clicking on it. All report lines require a Name, and can have an optional additional Code (of your choice) if you wish to use their value in formulas.
Uitdrukkingen¶
Each report line can contain one or multiple expressions. Expressions can be seen as sub-variables needed by a report line. To create an expression, click on Add a line within a report line.
When creating an expression, you must attribute a Label used to refer to that expression. Therefore, it has to be unique among the expressions of each line. Both a Computation Engine and a Formula must also be indicated. The engine defines how your formula(s) and subformula(s) are interpreted. It is possible to mix expressions using different computation engines under the same line if you need to.
Notitie
Afhankelijk van de engine kunnen ook subformules vereist zijn.
‘Odoo Domain’ engine¶
With this engine, a formula is interpreted as an Odoo domain
targeting account.move.line objects.
Met de subformule kun je definiëren hoe de boekingsregels die overeenkomen met het domein worden gebruikt om de waarde van de expressie te berekenen:
sumHet resultaat is de som van alle saldi van de gematchte boekingsregels.
sum_if_posHet resultaat is de som van alle saldi van de gematchte boekingsregels als dit bedrag positief is. Anders is het
0.sum_if_negHet resultaat is de som van alle saldi van de gematchte boekingsregels als dit bedrag negatief is. Anders is het
0.count_rowsThe result is the number of sub-lines of this expression. If the report line has a group-by value, this will correspond to the number of distinct grouping keys in the matched move lines. Otherwise, it will be the number of matched move lines.
You can also put a - sign at the beginning of the subformula to reverse the sign of the
result.
‘Aggregate Other Formulas’ engine¶
Use this engine when you need to perform arithmetic operations on the amounts obtained for other
expressions. Formulas here are composed of references to expressions separated by one of the four
basic arithmetic operators (addition +, subtraction -, division /, and multiplication *). To
refer to an expression, type in its report line’s code followed by a period . and the
expression’s label (ex. code.label).
Subformules kunnen een van de volgende zijn:
if_above(CUR(bedrag))De waarde van de rekenkundige expressie wordt alleen geretourneerd als deze groter is dan de opgegeven grens. Anders is het resultaat
0.if_below(CUR(bedrag))De waarde van de rekenkundige expressie wordt alleen geretourneerd als deze lager is dan de opgegeven grens. Anders is het resultaat
0.if_between(CUR1(bedrag1), CUR2(bedrag2))De waarde van de rekenkundige expressie wordt alleen geretourneerd als deze strikt tussen de opgegeven grenzen ligt. Anders wordt deze teruggebracht naar de dichtstbijzijnde grens.
if_other_expr_above(REGELCODE.EXPRESSIELABEL, CUR(bedrag))De waarde van de rekenkundige expressie wordt alleen geretourneerd als de waarde van de expressie aangegeven door de opgegeven regelcode en expressielabel groter is dan de opgegeven grens. Anders is het resultaat
0.if_other_expr_below(REGELCODE.EXPRESSIELABEL, CUR(bedrag))De waarde van de rekenkundige expressie wordt alleen geretourneerd als de waarde van de expressie aangegeven door de opgegeven regelcode en expressielabel lager is dan de opgegeven grens. Anders is het resultaat
0.
CUR is de valutacode in hoofdletters, en bedrag is het bedrag van de grens uitgedrukt in die valuta.
You can also use the cross_report subformula to match an expression found in another report.
‘Prefix of Account Codes’ engine¶
This engine is used to match amounts made on accounts using the prefixes of these accounts’ codes as variables in an arithmetic expression.
Example
21Example
21 + 10 - 521 en 10, en trekt het saldo af van die op rekeningen met het voorvoegsel 5.Het is ook mogelijk om een selectie van subvoorvoegsels te negeren.
Example
21 + 10\(101, 102) - 5\(57)101, 102 en 57.Je kunt ‘subfiltering’ toepassen op credits en debets met behulp van de C- en D-achtervoegsels. In dit geval wordt een rekening alleen beschouwd als het voorvoegsel overeenkomt, en als het totale saldo van de boekingsregels gemaakt op deze rekening credit/debet is.
Example
Rekening 210001 heeft een saldo van -42 en rekening 210002 heeft een saldo van 25. De formule 21D komt alleen overeen met rekening 210002 en geeft daarom 25 terug. 210001 komt niet overeen, omdat het saldo credit is.
Prefix-uitsluitingen kunnen worden gecombineerd met de achtervoegsels C en D.
Example
21D + 10\(101, 102)C - 5\(57)21 als het debet (D) is en 10 als het credit (C) is, maar negeert de prefixen 101, 102, en trekt het saldo af van rekeningen met het prefix 5, waarbij prefix 57 wordt genegeerd.Om de letter C of D in een prefix te matchen en niet als achtervoegsel te gebruiken, gebruik je een lege uitsluiting ().
Example
21D\()21D, ongeacht het teken van hun saldo.Naast het gebruik van codeprefixen om rekeningen op te nemen, kun je ze ook matchen met rekeninglabels. Dit is bijvoorbeeld vooral handig als je land geen gestandaardiseerd grootboekschema heeft, waarbij hetzelfde prefix voor verschillende doeleinden kan worden gebruikt bij verschillende bedrijven.
Example
tag(25)If the tag you reference is defined in a data file, an xmlid can be used instead of the id.
Example
tag(my_module.my_tag)Je kunt ook rekenkundige expressies met labels gebruiken, eventueel in combinatie met prefixselecties.
Example
tag(my_module.my_tag) + tag(42) + 1010Achtervoegsels C en D kunnen op dezelfde manier worden gebruikt met labels.
Example
tag(my_module.my_tag)CPrefix-uitsluiting werkt ook met labels.
Example
tag(my_module.my_tag)\(10)10.‘External Value’ engine¶
The ‘external value’ engine is used to refer to manual and carryover values. Those values
are not stored using account.move.line, but with account.report.external.value. Each of these
objects directly points to the expression it impacts, so very little needs to be done about their
selection here.
Formules kunnen een van de volgende zijn:
sumAls het resultaat de som moet zijn van alle externe waarden in de periode.
most_recentAls het resultaat de waarde moet zijn van de laatste externe waarde in de periode.
Daarnaast kunnen subformules op twee manieren worden gebruikt:
rounding=XAls je
Xvervangt door een getal, wordt het bedrag afgerond op X decimalen.editableGeeft aan dat deze expressie handmatig kan worden bewerkt, wat de weergave van een icoon in het rapport triggert, waarmee de gebruiker deze actie kan uitvoeren.
Notitie
Handmatige waarden worden aangemaakt op de date_to die momenteel in het rapport is geselecteerd.
Beide subformules kunnen worden gecombineerd door ze te scheiden met een ;.
Example
editable;rounding=2‘Custom Python Function’ engine¶
This engine is a means for developers to introduce custom computation of expressions on a case-by-case basis. The formula is the name of a python function to call, and the subformula is a key to fetch in the dictionary returned by this function. Use it only if you are making a custom module of your own.
Kolommen¶
Rapporten kunnen een onbepaald aantal kolommen hebben om weer te geven. Elke kolom haalt zijn waarden uit de expressies die op de regels zijn gedeclareerd. Het veld expression_label van de kolom geeft het label van de expressies waarvan de waarde wordt weergegeven. Als een regel geen expressie in dat veld heeft, wordt er niets voor weergegeven in deze kolom. Als meerdere kolommen vereist zijn, moet je verschillende expressie-labels gebruiken.
Bij gebruik van de functie perioden vergelijken onder het tabblad Opties van een boekhoudrapport worden alle kolommen herhaald in en voor elke periode.
Custom tax report setup¶
Report configuration¶
Tip
All technical terms and functions of Odoo’s reports engine are explained in the previous sections of this page. We strongly recommend reading these sections before setting up a custom tax report.
To create a custom tax report, open the Accounting app, navigate to , then click New:
Enter a name for your report.
Select a Root Report.
Under the Availability field, select Country Matches, then select the Country matching your company.
Next, create a report line by clicking the Add a line. Once created, click that report line to configure it:
Click Add a line again to create an Expression and name it.
In the Definition tab, select a Computation Engine for that expression depending on the following scenarios:
In this scenario, your company uses tax grids:
Select Tax Tags as the computation engine. Odoo uses this field to link the report line to your taxes.
In the Formula field, type your short grid identifier (e.g.,
vat_sales_base). Odoo automatically generates the+and-variants of this tag for you to map inside .In the Subformula field, enter either
baseto report the untaxed amount, ortaxto report the actual tax amount collected/paid.
Repeat this process as necessary. Then, Save & Close.
Alternatively, you can:
Select Aggregate Other Formulas as the computation engine. Odoo uses this field to perform math on lines already present in the report rather than scanning raw transactions.
In the Formula field, use basic algebra referencing your line codes (e.g.,
LINE_10 - LINE_20).
Repeat this process as necessary. Then, Save & Close.
In this scenario, your company does not use tax grids. Instead, it tracks everything strictly via General Ledger accounts:
Select Prefix of Account Codes as the computation engine: Odoo uses this for lines that need to pull financial totals. Instead of looking for transaction tags, Odoo pulls live balances directly from your chart of accounts.
In the Formula field, type the starting digits of the accounts you want to track, (e.g.,
40will pull the combined total of all revenue accounts starting with400000,401000, etc.).
Repeat this process as necessary. Then, Save & Close.
Alternatively, you can:
Select Aggregate Other Formulas as the computation engine. Odoo uses this to calculate subtotals, net tax, or grand totals by adding or subtracting your other report lines.
In the Formula field, use basic algebra referencing your line codes (e.g.,
LINE_10 - LINE_20).
Repeat this process as necessary. Then, Save & Close.
In this scenario, your company requires advanced filtering, manual user overrides, or complex algorithmic logic that standard tags and account prefixes cannot handle:
Select Odoo Domain as the computation engine: Odoo uses this to bypass tax tags entirely and filter raw journal items (
account.move.line) using standard Odoo search syntax.In the Formula field, enter a valid domain starting with brackets to isolate tax-exempt transactions for specific partner categories.
Alternatively, you can:
Select External Value as the computation engine. Odoo uses this to log manual overrides or historical carryover values.
In the Formula field, type either
sum(to add all manual values together over multi-period reports) ormost_recent(to display only the latest value).In the Subformula field, type
editableto display an edit icon on the live report, allowing users to modify the value manually. Additionally, you can round numbers by typingrounding=x.
Alternatively, you can:
Select Custom Python Function as the computation engine. Odoo uses this as an execution engine to run specific calculations through backend coding when rules involve progressive brackets, loops, or multi-tier thresholds.
In the Formula field, enter the exact technical name of the Python method defined in your custom localization module.
Repeat this process as necessary. Then, Save & Close.
In the Options tab of an Expression, populate the Carry Over To field with a formula to always carry over balances or only carry them over when the amount is negative. Leave this field blank if you do not want to use this feature.
Example
if_below(EUR(0))Tax configuration¶
Next, go to and click New to create and configure new taxes for your custom tax report. Create your Sales and Purchases taxes, and populate the Tax Grids for all taxes using the matching tax grids you created earlier. Finally, make sure to specify both a tax payable and tax receivable account for each tax.
Example
Closing entry¶
To close taxes, a tax group must be specified on each tax used in your custom tax report. To do this, open the Accounting app, navigate to , open a tax that requires a tax group, click the Advanced Options tab, and select a group in the Tax Group field. Once assigned, click the (right arrow) icon and set both a Tax Payable Account and a Tax Receivable Account.
Tip
When everything has been set up, make sure to test your report by creating invoices, bills, and credit notes using the taxes specific to that report. Finally, test the closing entry itself.
If you want to hide a specific account from displaying in the tax closing entry, go to , select the tax, and click the (settings adjust) icon. From there, check the Tax Closing Entry box to adjust its visibility.
Zie ook