Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 184 additions & 0 deletions report_printed_flag/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
===================
Report Printed Flag
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5d5058bfc9e97f0956c7e54b952e643c0f1a9dcb2ac49f57270d430c82c62804
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/17.0/report_printed_flag
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_printed_flag
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module provides a generic and extensible configuration layer to
mark records as printed when specific PDF reports are generated.

Main features:

- **Reusable Mixin** (``report.printed.mixin``) that any model can
inherit to gain:

- A ``printed`` Boolean field
- A ``printed_log_ids`` One2many relation to audit logs
- A ``printed_report_names`` computed field with printed report names
- An ``action_view_printed_logs()`` method

- Generic configuration per company and model
- Per-report configuration using rules
- Optional domain conditions per report
- Automatic printed flag update
- Optional logging of report executions
- Optional computation of printed report names
- Full multi-company support with isolated configurations
- User interface for browsing printed report logs

Extension modules simply inherit the mixin:

.. code:: python

class AccountMove(models.Model):
_name = 'account.move'
_inherit = ['account.move', 'report.printed.mixin']

All printed flag functionality is inherited automatically.

Limitations:

- Only applies to QWeb PDF reports (``qweb-pdf``)
- Extension modules must inherit ``report.printed.mixin`` to gain
printed field support
- Domain expressions must be valid Python domains

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

For End Users
=============

1. Install ``report_printed_flag`` module
2. Install extension modules that support printed flags (e.g.,
``report_printed_flag_account``)
3. Go to *Settings > Reporting > Printed Flag > Configurations*
4. Create a configuration for your model (Company + Model)
5. Add report rules (select report + optional domain condition)
6. Generate a configured report from a document (e.g., print an invoice)

Result:

- The ``printed`` field is automatically set to ``True``
- A log entry is created (if enabled in configuration)
- Printed report names are computed (if enabled in configuration)

Access logs via:

*Settings > Reporting > Printed Flag > Logs*

For Module Developers
=====================

To add printed flag support to a custom model:

1. Create your model inheriting from ``report.printed.mixin``:

class MyModel(models.Model): \_name = 'my.model' \_inherit =
['my.model', 'report.printed.mixin']

2. Create QWeb PDF reports for your model (standard Odoo process)

3. Instruct users to configure which reports trigger the printed flag
via the UI

That's it! The mixin provides all field and method implementations
automatically.

Optional: Add UI Elements
-------------------------

You may optionally add buttons to your views to open the logs:

::

<button name="action_view_printed_logs"
type="object"
string="View Printed Logs"
icon="fa-print"
invisible="not printed_report_names"/>

Known issues / Roadmap
======================

- Provide official extension modules (stock, account)
- Add support for additional report types (HTML, XLSX)
- Optimize performance for high-volume batch printing
- Improve handling of large datasets

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_printed_flag%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Binhex Systems Solutions S.L

Contributors
------------

- `Binhex Systems Solutions S.L. <https://www.binhex.cloud>`__:

- Ariel Torres
- Rolando Pérez Rebollo

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/17.0/report_printed_flag>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions report_printed_flag/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions report_printed_flag/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Report Printed Flag",
"summary": "Configure reports that mark records as printed",
"version": "17.0.1.0.0",
"category": "Tools",
"license": "AGPL-3",
"author": "Binhex Systems Solutions S.L, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
"depends": [
"base",
Comment thread
atgalvez08 marked this conversation as resolved.
"web",
],
"data": [
"security/security.xml",
"security/ir.model.access.csv",
"views/report_printed_config_views.xml",
"views/report_printed_log_views.xml",
"views/menu_views.xml",
],
"installable": True,
"development_status": "Alpha",
}
Loading
Loading