Skip to content
Open
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
6 changes: 6 additions & 0 deletions setup/web_font_size_report_layout/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
114 changes: 114 additions & 0 deletions web_font_size_report_layout/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
===================================
Report Font Size in Document Layout
===================================

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

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/16.0/web_font_size_report_layout
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_font_size_report_layout
: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/web&target_branch=16.0
:alt: Try me on Runboat

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

This Odoo module adds the capability to customize font size in all PDF
reports throughout the system. Through a simple configuration,
administrators can select from a range of predefined font sizes
(measured in points) to optimize readability and appearance of invoices,
quotations, sales orders, and other printed documents.

The module offers the following font size options (in points):

=========== ==== =========================
Option Size Description
=========== ==== =========================
Small 9pt For maximum compactness
Standard 10pt Odoo's default size
Large 12pt Better readability
Extra Large 14pt For high visibility needs
=========== ==== =========================

**Table of contents**

.. contents::
:local:

Installation
============

1. Copy the ``web_font_size_report_layout`` directory to your Odoo
addons folder
2. Update the module list from developer mode
3. Search for "Report Font Size in Document Layout" in the app store and
install it.

Usage
=====

Once installed:

1. Go to **Settings → General Settings → Companies → Configure Document
Layout**
2. Locate the new **"Font Size"** field
3. Select your preferred size from the dropdown list
4. Look at Preview or Download PDF Preview
5. Save changes

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/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/web/issues/new?body=module:%20web_font_size_report_layout%0Aversion:%2016.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

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

- `Binhex <https://www.binhex.cloud>`__:
- Mario Montes<m.montes@binhex.cloud>
- Abraham J. Febres <afebres@binhex.cloud>

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/web <https://github.com/OCA/web/tree/16.0/web_font_size_report_layout>`_ 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 web_font_size_report_layout/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions web_font_size_report_layout/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Report Font Size in Document Layout",
"version": "16.0.1.1.0",
"summary": "Adds a font size selector (pt) to the Document Layout wizard",
"author": "Binhex," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"license": "LGPL-3",
"depends": ["web"],
"data": [
"views/base_document_layout_views.xml",
"views/report_templates_inherit.xml",
],
"assets": {
"web.report_assets_common": [
"web_font_size_report_layout/static/src/scss/report_font_size.scss"
],
"web.report_assets_pdf": [
"web_font_size_report_layout/static/src/scss/report_font_size.scss"
],
},
"installable": True,
}
2 changes: 2 additions & 0 deletions web_font_size_report_layout/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import res_company
from . import base_document_layout
19 changes: 19 additions & 0 deletions web_font_size_report_layout/models/base_document_layout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from odoo import api, fields, models


class BaseDocumentLayout(models.TransientModel):
_inherit = "base.document.layout"

report_font_size = fields.Selection(
related="company_id.report_font_size",
readonly=False,
string="Font size",
)

@api.onchange("report_font_size")
def _onchange_report_font_size(self):
if hasattr(self, "_compute_preview"):
try:
self._compute_preview()
except Exception:
self.preview = False
47 changes: 47 additions & 0 deletions web_font_size_report_layout/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from odoo import api, fields, models


class ResCompany(models.Model):
_inherit = "res.company"

report_font_size = fields.Selection(
selection=[
("9", "9 pt"),
("10", "10 pt"),
("11", "11 pt"),
("12", "12 pt"),
("13", "13 pt"),
("14", "14 pt"),
],
string="Report font size",
default="11",
help="Base font size for PDF content (in points), applied on the external "
"report layout.",
)

@api.model_create_multi
def create(self, vals_list):
companies = super().create(vals_list)
style_fields = {
"external_report_layout_id",
"font",
"report_font_size",
"primary_color",
"secondary_color",
}
if any(not style_fields.isdisjoint(values) for values in vals_list):
self._update_asset_style()
return companies

def write(self, values):
res = super().write(values)
style_fields = {
"external_report_layout_id",
"font",
"report_font_size",
"primary_color",
"secondary_color",
}
if not style_fields.isdisjoint(values):
self._update_asset_style()
return res
3 changes: 3 additions & 0 deletions web_font_size_report_layout/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions web_font_size_report_layout/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Binhex](https://www.binhex.cloud):
- Mario Montes\<<m.montes@binhex.cloud>\>
- Abraham J. Febres \<<afebres@binhex.cloud>\>
10 changes: 10 additions & 0 deletions web_font_size_report_layout/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This Odoo module adds the capability to customize font size in all PDF reports throughout the system. Through a simple configuration, administrators can select from a range of predefined font sizes (measured in points) to optimize readability and appearance of invoices, quotations, sales orders, and other printed documents.

The module offers the following font size options (in points):

| Option | Size | Description |
|--------|------|-------------|
| Small | 9pt | For maximum compactness |
| Standard | 10pt | Odoo's default size |
| Large | 12pt | Better readability |
| Extra Large | 14pt | For high visibility needs |
3 changes: 3 additions & 0 deletions web_font_size_report_layout/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. Copy the `web_font_size_report_layout` directory to your Odoo addons folder
2. Update the module list from developer mode
3. Search for "Report Font Size in Document Layout" in the app store and install it.
7 changes: 7 additions & 0 deletions web_font_size_report_layout/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Once installed:

1. Go to **Settings → General Settings → Companies → Configure Document Layout**
2. Locate the new **"Font Size"** field
3. Select your preferred size from the dropdown list
5. Look at Preview or Download PDF Preview
4. Save changes
Loading