# Add Action report for Balance Sheet and Profit and Loss

**URL:** <https://discuss.tryton.org/t/add-action-report-for-balance-sheet-and-profit-and-loss/3216>\
**Category:** Ideas\
**Created:** [September 14, 2020, 2:07pm UTC](https://discuss.tryton.org/t/add-action-report-for-balance-sheet-and-profit-and-loss/3216 "2020-09-14T14:07:12Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![josesalvador](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/josesalvador/32/602_2.png) [@josesalvador](https://discuss.tryton.org/u/josesalvador)\
**Post date:** [September 17, 2020, 10:33am UTC](https://discuss.tryton.org/t/add-action-report-for-balance-sheet-and-profit-and-loss/3216/21 "2020-09-17T10:33:28Z")

</div>

> [@pokoli](#):
>
> This is not for only internal reporting but for external reporting. The reports should be sent to:
> 
> - Banks when asking for a loan
> - Inverstors of the company

And authorities as [Registro Mercantil](https://www.registradores.org/el-colegio/registro-mercantil).

---

<div class="post-metadata">

**Author:** ![eleazar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/eleazar/32/488_2.png) [@eleazar](https://discuss.tryton.org/u/eleazar)\
**Post date:** [October 4, 2020, 1:03pm UTC](https://discuss.tryton.org/t/add-action-report-for-balance-sheet-and-profit-and-loss/3216/22 "2020-10-04T13:03:36Z")

</div>

He leído con detenimiento lo expuesto y es realmente necesario el poder imprimir los balances, en Venezuela es imprescindible para cualquier gestión bancaria ó con los entes de gobierno, si tienes una auditoria de impuestos solicitan los libros al igual que un balance impreso y el estado de Ganancias y Pérdidas.

Con los sistemas que he manejado la diferencia de estos reportes son prácticamente imperceptible varia solo la posición de la información ó la profundidad en el detalle.

Tryton ha logrado cubrir en gran medida todas las necesidades y requerimientos en la legislación y manejo de la empresa aquí en Venezuela, inclusive a superado con creces las expectativas. Pero no he de negar que realmente echo de menos los reportes de balance general y ganancias y perdidas impresos ó en PDF que se obtienen con el sistema anterior.

Aun en estos tiempos de documentación digital la legislación nos exige mantener copia impresa de estos reportes al menos por 10 años.

Estaremos al pendiente del progreso de esta discusión, mientras agradeceria me indiquen como obtengo el CVS para ajustarlo en mis formatos anteriores.

Aquí unas capturas de los que se obtenia en el sistema anterior:  
Balance General

 ![Captura de pantalla_2020-10-04_08-55-38](https://discuss-cdn.tryton.org/uploads/default/original/2X/f/f024dada0f34d419a6c7b63caa109160f14c49a3.png) Ganancias y Pérdidas  
 ![Captura de pantalla_2020-10-04_08-46-50](https://discuss-cdn.tryton.org/uploads/default/original/2X/8/8e1ebab78e072b77dd2dadd21ef05c541bee66aa.png)

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [February 17, 2021, 12:00pm UTC](https://discuss.tryton.org/t/add-action-report-for-balance-sheet-and-profit-and-loss/3216/23 "2021-02-17T12:00:59Z")

</div>

I think I got a solution to fix both problems the CSV export and the report on tree structure.

First we add a forth key to the data sent to the report. It contains the indentation level for every `ids` (empty for list). This information can be used on the template to indent the records correctly. This prevents to compute it on the server side which may not be reliable depending on the actual root in the client and if the type of graph the tree is (if parent is a `Many2One` or `Many2Many`).

Second on `ir.action` we allow to specify if the action runs on the selected records or the listed record. This is similar to [Add export CSV route (#9090) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue9090). For tree this means that it is the ids of all the rows which has a parent expanded.This way report that has meaning only as an all, can set this flag and always be complete (of course there are always the case of newly created node between the client read and the report generation but I think it can be understood).

Third the CSV export that are using “Listed Record” and based on a tree, we do not use the domain (which limit only to roots) but use the rows which has a parent expanded. And when formatting the lines, we add spaces to the first column following the level.

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [February 18, 2021, 6:00pm UTC](https://discuss.tryton.org/t/add-action-report-for-balance-sheet-and-profit-and-loss/3216/24 "2021-02-18T18:00:33Z")

</div>

Here are:

- [Improve report and CSV for tree structure (#10116) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue10116)
- [Add report for income statement and balance sheet (#10117) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue10117)

[Previous page](https://discuss.tryton.org/t/add-action-report-for-balance-sheet-and-profit-and-loss/3216.md?page=1)
