-
-
Notifications
You must be signed in to change notification settings - Fork 887
[17.0][ADD] report_printed_flag #1161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
atgalvez08
wants to merge
1
commit into
OCA:17.0
Choose a base branch
from
BinhexTeam:17.0-add-report_printed_flag
base: 17.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| "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", | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.