Rapoarte Personalizate¶
Odoo comes with a powerful and easy-to-use reporting framework. The engine allows you to create new reports, such as tax reports, balance sheets, and income statements with specific groupings and layouts.
Important
Activate the developer mode to access the accounting report configuration.
To create a new report, go to root report or a variant.
. From here, create either aSfat
Consider saving modified reports as report variants to keep their root reports intact.
To access an existing report’s management interface from the report itself, click on the (gears) icon.
Rapoarte rădăcină¶
Rapoartele rădăcină pot fi considerate rapoarte contabile generice, neutre. Acestea servesc drept modele pe care sunt construite versiunile de contabilitate locală. Dacă un raport nu are un raport rădăcină, este considerat a fi un raport rădăcină în sine.
Example
Un raport fiscal pentru Belgia și SUA ar folosi aceeași versiune generică ca bază și ar adapta-o pentru reglementările lor interne.
Creating a menu item is required to access a new root report. To do so, open the report’s configuration, click Action, Create Menu Item, and refresh the page. The report is now available under .
Notă
Cazurile care necesită crearea unui nou raport rădăcină sunt rare, cum ar fi atunci când autoritățile fiscale ale unei țări solicită un tip de raport nou și specific.
Variante¶
Variantele sunt versiuni specifice țării ale rapoartelor rădăcină și, prin urmare, se referă întotdeauna la un raport rădăcină. Pentru a crea o variantă, selectați un raport generic (rădăcină) în câmpul Raport rădăcină când creați un nou raport.
When a root report is opened from the Accounting app’s Reporting menu, all of its variants are displayed in the report variant selector in the top right corner of the view.
Example
VAT Report (BE) is a variant of the root Generic Tax report.

Linii¶
After creating a report (either root or variant), the next step is to fill it with lines. To create a new line, click on Add a line. To modify an existing line, click on the line itself and edit the popup. All lines require a Name and can have an optional Code which allows using the line’s value in formulas.

Expresii¶
Each 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 line’s popup.
When creating an expression, you must enter a Label used to refer to that expression. The label must be unique among the expressions of each report line. Both the Computation Engine and the Formula fields must also be completed. The computation engine defines how the formula(s) and subformula(s) are interpreted. It is possible to mix expressions using different computation engines under the same line if needed.
Notă
În funcție de motor, pot fi necesare și subformulele.
Odoo Domain computation engine¶
When using the Odoo Domain computation engine, a formula is interpreted as an Odoo
domain targeting account.move.line
objects.
Subformula vă permite să definiți cum sunt utilizate liniile de mutare care se potrivesc domeniului pentru a calcula valoarea expresiei:
suma
Rezultatul este suma tuturor soldurilor liniilor de mutare potrivite.
sum_if_pos
Rezultatul este suma tuturor soldurilor liniilor de mutare potrivite dacă această sumă este pozitivă. În caz contrar, este
0
.sum_if_neg
Rezultatul este suma tuturor soldurilor liniilor de mutare potrivite dacă această sumă este negativă. În caz contrar, este
0
.count_rows
The result is the number of sub-lines of this expression. If the parent 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.
Sfat
To reverse the sign of the result, put a -
sign at the beginning of the subformula.

Aggregate Other Formulas computation engine¶
The Aggregate Other Formulas computation engine performs arithmetic operations on the
amounts obtained from 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 parent line’s code followed
by a period .
and the expression’s label (ex. code.label).
Subformulele pot fi una dintre următoarele:
if_above(CUR(amount))
Valoarea expresiei aritmetice va fi returnată numai dacă este mai mare decât limita furnizată. În caz contrar, rezultatul va fi
0
.if_below(CUR(amount))
Valoarea expresiei aritmetice va fi returnată numai dacă este mai mică decât limita furnizată. În caz contrar, rezultatul va fi
0
.if_between(CUR1(amount1), CUR2(amount2))
Valoarea expresiei aritmetice va fi returnată numai dacă se află strict între limitele furnizate. În caz contrar, va fi adus înapoi la limita cea mai apropiată.
if_other_expr_above(LINE_CODE.EXPRESSION_LABEL, CUR(amount))
Valoarea expresiei aritmetice va fi returnată numai dacă valoarea expresiei indicată de codul liniei furnizate și eticheta expresiei este mai mare decât limita furnizată. În caz contrar, rezultatul va fi
0
.if_other_expr_below(LINE_CODE.EXPRESSION_LABEL, CUR(amount))
Valoarea expresiei aritmetice va fi returnată numai dacă valoarea expresiei indicată de codul liniei furnizate și eticheta expresiei este mai mică decât limita furnizată. În caz contrar, rezultatul va fi
0
.
CUR
este codul monedei cu majuscule, iar amount
este valoarea limitei exprimată în acea monedă.
De asemenea, puteți utiliza subformula cross_report
pentru a potrivi o expresie găsită într-un alt raport.
Prefix of Account Codes computation engine¶
The Prefix of Account Codes computation engine is used to match amounts made on accounts using the prefixes of these accounts» codes as variables in an arithmetic expression.
Example
21
Example
21 + 10 - 5
21
și 10
și scade soldul celor pe conturi cu prefixul 5
.De asemenea, este posibil să ignorați o selecție de sub-prefixe.
Example
21 + 10\(101, 102) - 5\(57)
101
, 102
și 57
.Putem aplica «sub-filtrare» pe credite și datorii folosind C
și D
sufixe. În acest caz, un cont va fi luat în considerare doar dacă prefixul se potrivește, și dacă totalul soldului liniei de mutare făcute pe acest cont este credit/debit.
Example
Contul 210001
are un sold de -42 și contul 210002
are un sold de 25. Formula 21D
se potrivește doar cu contul 210002
, și de aceea returnează 25. 210001
nu este potrivit, deoarece soldul său este credit.
Excluderile prefixului pot fi amestecate cu C
și D
sufixele.
Example
21D + 10\(101, 102)C - 5\(57)
21
dacă este debit (D
) și 10
dacă este credit (C
), dar ignoră prefixele 101
, 102
, și scade soldul celor de pe conturi cu prefixul 5
, ignorând prefixul 57
.Pentru a se potrivi cu litera C
sau D
într-un prefix și nu-l folosi ca sufix, utilizați o excludere goală ()
.
Example
21D\()
21D
, indiferent de semnul lor de sold.Pe lângă utilizarea prefixelor de cod pentru a include conturi, le puteți asocia și cu etichete de cont. Acest lucru este util în special, de exemplu, dacă țara dvs. nu are un plan de conturi standardizat, în care același prefix poate fi utilizat în scopuri diferite de la o companie.
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)
De asemenea, puteți utiliza expresii aritmetice cu etichete, eventual combinându-le cu selecții de prefix.
Example
tag(my_module.my_tag) + tag(42) + 10
10
Sufixele C
și D
pot fi folosite în același mod cu etichetele.
Example
tag(my_module.my_tag)C
Excluderea prefixului funcționează și cu etichete.
Example
tag(my_module.my_tag)\(10)
10
.External Value computation engine¶
The External Value computation 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.
Formulele pot fi una dintre următoarele:
suma
Dacă rezultatul trebuie să fie suma tuturor valorilor externe în perioada.
most_recent
Dacă rezultatul trebuie să fie valoarea ultimei valori externe în perioada.
În plus, subformulele pot fi utilizate în două moduri:
rounding=X
Înlocuirea
X
cu un număr instruiește să rotunjească suma la X zecimale.editable
Indică că această expresie poate fi editată manual, declanșând afișarea unui icon în raport, permițând utilizatorului să efectueze această acțiune.
Notă
Valorile manuale sunt create la date_to
selectat în prezent în raport.
Ambele subformule pot fi amestecate prin separarea lor cu un ;
.
Example
editable;rounding=2
Custom Python Function computation engine¶
The Custom Python Function computation 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 this computation engine only if making a custom module.
Coloane¶
Rapoartele pot avea un număr nelimitat de coloane pentru afișare. Fiecare coloană primește valorile din expresiile declarate pe linii. Câmpul expression_label al coloanei dă eticheta expresiilor ale căror valori sunt afișate. Dacă o linie nu are expresie în acel câmp, atunci nimic nu este afișat pentru ea în această coloană. Dacă sunt necesare mai multe coloane, trebuie să utilizați etichete diferite de expresie.

Când utilizați funcția comparare perioadă găsită în fila Opțiuni a unui raport contabil, toate coloanele sunt repetate în și pentru fiecare perioadă.
Line grouping¶
Non-standard grouping is possible by adding or using existing fields on the Journal Item model, provided that the fields are related and non-stored.
Notă
Grouping lines requires the report to have explicit report lines that can be edited. The deferred reports, for example, do not support grouping lines as they use dynamic lines that are generated.
Create a new field on journal item¶
To create a non-stored, related field in the Journal Item model, first go to (bug) icon, then click Fields. Click New to create a new field, and complete the following fields:
, and click theField Name: a technical name for the field
Field Label: the label to be displayed for the field
Field Type: the type of field that this related field should point to
Stored: Leave this field unchecked as only non-stored fields can be used to group lines.
Related Model: If the field type is one2many, many2many, or many2one, select the model of the original field to group by.
Related Field Definition: the technical path to the field you want to group by
Example
To group by the sales team of the commercial partner, set the related field definition to
move_id.team_id
.
Group lines¶
To group lines, go to the Lines tab of the desired report, click on the line you want to group, and edit the Group by field. Enter the technical name (Field Name) of the field to use as the grouping key.
Sfat
To find a list of all the model’s fields and their technical names, go to (bug) icon, then click Fields. The technical name of each field is listed in the Field Name column.
, and click the