Metadata-Version: 2.1
Name: odoo-addon-report_css_injection
Version: 18.0.1.0.0.1
Requires-Python: >=3.10
Requires-Dist: odoo==18.0.*
Summary: Change reports font size and other css from the document layout configurator
Home-page: https://github.com/sygel-technology/sy-reporting-engine
License: AGPL-3
Author: Sygel
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

====================
Report CSS Injection
====================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |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-sygel--technology%2Fsy--reporting--engine-lightgray.png?logo=github
    :target: https://github.com/sygel-technology/sy-reporting-engine/tree/18.0/report_css_injection
    :alt: sygel-technology/sy-reporting-engine

|badge1| |badge2| |badge3|

This module allows users to adjust the font size of company PDF reports
(invoices, sales orders, delivery slips, etc.) directly from the
document layout settings.

For advanced visual customization (colors, margins, spacing, etc.),
custom CSS can be defined in developer mode. Changes apply globally per
company.

**Table of contents**

.. contents::
   :local:

Configuration
=============

Basic configuration (functional users)
--------------------------------------

To configure the font size, you need to:

- Go to Settings / General Settings / Companies, and click on the
  'Configure Document Layout' button
- Edit text size, text size unit, header size, and header size unit

Advanced configuration (technical users)
----------------------------------------

To directly customize the report css, you need to

- Go to Settings / General Settings / Companies, and click on the
  'Configure Document Layout' button
- Activate the developer mode
- Go to custom CSS, and write your css there.

Custom CSS affects all company PDF reports and should only be modified
by a technical user.

Here you have a list of css code examples you can insert into the custom
css.

- **Usefull css properties**:

  ::

     line-height: 1.5;
     font-weight: 300;
     margin: 0 100px;
     color: blue;

- **Special css selectors**. Some text blocks of the reports are not
  edited by normal css because they use special classes that overwrite
  the main css, you should use this special css selectors to edit those
  blocks:

  ::

     h2 {
         color: blue;
     }
     #informations strong {
         color: blue;
     }
     table * {
         color: blue !important;
     }

- **Font size css**. It can be usefull knowing that the font size fields
  of the form view injects a css similar to the following one, with the
  same attributes and selectors:

  ::

     font-size: 16.0px;
     h2 {
         font-size: 32.0px;
     }

Usage
=====

To use this module, print a report after changing the configuration. The
font size will be your configured one.

This module replaces the old "reports_font_size" module

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

- More css units can be added.

- The names of the added variables (text_size, text_size_unit...) are
  too generic, and could be added by Odoo in the next versions. Check if
  this happened in the future migrations

- The \_get_asset_style_b64() call when updating the
  web.asset_styles_company_report attachment has been overwritten,
  replacing it for \_custom_get_asset_style_b64(). The reason is that,
  without this change, a update of the base module deletes the css
  injection. Modules that inherits the \_get_asset_style_b64 function
  might be incompatible. This was the only way found to fix this issue.

- If a report uses special custom classes, the font size could not be
  changed. It is not common, but it has been detected that it happens
  with the boxed reports in v16. It can also happen if a report uses
  headers other than h2. If this happens to you, tell the technician who
  creates CSS for you. Example to solve the size of headers 1, and the
  direction of the boxed:

  ::

     font-size: 20px;
     h1 {
         font-size: 40px;
     }
     .o_boxed_header {
         font-size: 20px;
     }

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

Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-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/sygel-technology/sy-reporting-engine/issues/new?body=module:%20report_css_injection%0Aversion:%2018.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
-------

* Sygel

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

- Valentin Vinagre valentin.vinagre@sygel.es
- Alberto Martínez alberto.martinez@sygel.es
- Harald Panten harald.panten@sygel.es

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

This module is part of the `sygel-technology/sy-reporting-engine <https://github.com/sygel-technology/sy-reporting-engine/tree/18.0/report_css_injection>`_ project on GitHub.

You are welcome to contribute.
