Skip to content
Health
72/100
fair
  • Security22/25
    1 minor finding
  • Activity25/25
    Last human commit 1 month ago
  • Required by20/25
    2 modules depend on it
  • Maturity5/25
    In 1 Odoo series since 17.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
2
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.12 MB
Module directory on disk
Code analysis 3 migration notes 5 models 5 views 0 HTTP endpoints

Description

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:

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

Dependencies

Odoo dependencies
odoo/odoo:
- web
Python dependencies
None
System dependencies
None
Required by
account_invoice_report_printed_flag, stock_picking_report_printed_flag

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 5

XML IDNameModelTypeStatus
view_report_printed_config_form report.printed.config.form report.printed.config form New
view_report_printed_config_search report.printed.config.search report.printed.config search New
view_report_printed_config_tree report.printed.config.tree report.printed.config tree New
view_report_printed_log_search report.printed.log.search report.printed.log search New
view_report_printed_log_tree report.printed.log.tree report.printed.log tree New

HTTP endpoints 0

No HTTP endpoints found for this module.

Models touched 5

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (11)
  • active Boolean
    default=True
  • allowed_model_ids Many2many → ir.model
    default=<expr> args: 'ir.model'
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> ondelete='cascade' required=True
  • display_name Char
    compute='_compute_display_name' store=True
  • line_ids One2many → report.printed.config.line
    string='Report Rules' args: 'report.printed.config.line', 'config_id'
  • model Char
    readonly=True related='model_id.model' store=True string='Technical Model'
  • model_id Many2one → ir.model
    domain="[('transient', '=', False), ('id', 'in', allowed_model_ids)]" ondelete='cascade' required=True args: 'ir.model'
  • name Char
    required=True translate=True
  • note Text
  • report_printed_log_active Boolean
    default=True string='Enable Printed Logs'
  • report_printed_names_active Boolean
    default=True string='Enable Printed Report Names'
Public methods (0)

No public methods.

New fields (3)
  • config_id Many2one → report.printed.config
    ondelete='cascade' required=True args: 'report.printed.config'
  • domain Char
  • report_id Many2one → ir.actions.report
    required=True args: 'ir.actions.report'
Public methods (0)

No public methods.

New fields (6)
  • company_id Many2one → res.company
    required=True args: 'res.company'
  • name Char
    required=True
  • report_id Many2one → ir.actions.report
    ondelete='cascade' required=True args: 'ir.actions.report'
  • res_id Many2oneReference
    index=True model_field='res_model' required=True string='Related Record'
  • res_model Char
    index=True required=True
  • user_id Many2one → res.users
    default=<expr> required=True args: 'res.users'
Public methods (0)

No public methods.

New fields (3)
  • printed Boolean
    copy=False default=False help='Indicates whether at least one configured report has been printed for this record.' index=True
  • printed_log_ids One2many → report.printed.log
    help='Technical relation to printed logs using a generic reference pattern (res_model, res_id). Only logs related to this model type are included.' string='Print Logs' args: 'report.printed.log', 'res_id'
  • printed_report_names Char
    compute='_compute_printed_report_names' help='Comma-separated list of printed report names, computed from related printed logs. Only active if enabled in configuration.' store=True string='Printed Reports Names'
Public methods (1)
  • action_view_printed_logs(self)
    Open a tree view displaying printed logs related to this record. Returns: dict: Standard Odoo action opening ``report.printed.log`` records filtered by this record's (res_model, res_id). Notes: - Uses ensure_one() as the action is record-specific - Designed to be called from UI buttons