Skip to content

Commit 5980359

Browse files
ajfebresadasatorres
authored andcommitted
[ADD] web_font_size_report_layout: web_font_size_report_layout module added.
1 parent e9d3c78 commit 5980359

19 files changed

+968
-0
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
===================================
2+
Report Font Size in Document Layout
3+
===================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:ee6f96a1077aace09df8bdf60b5d93ee172924b3bf73a462880b7c52adf87ab2
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
20+
:target: https://github.com/OCA/web/tree/18.0/web_font_size_report_layout
21+
:alt: OCA/web
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_font_size_report_layout
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This Odoo module adds the capability to customize font size in all PDF
32+
reports throughout the system. Through a simple configuration,
33+
administrators can select from a range of predefined font sizes
34+
(measured in points) to optimize readability and appearance of invoices,
35+
quotations, sales orders, and other printed documents.
36+
37+
The module offers the following font size options (in points):
38+
39+
============ ==== =========================
40+
Option Size Description
41+
============ ==== =========================
42+
Extra Small 9pt For maximum compactness
43+
Standard 10pt Odoo's default size
44+
Small 11pt Just a little larger
45+
Large 12pt Better readability
46+
Extra Large 13pt Really Large
47+
2Extra Large 14pt For high visibility needs
48+
============ ==== =========================
49+
50+
**Table of contents**
51+
52+
.. contents::
53+
:local:
54+
55+
Installation
56+
============
57+
58+
1. Copy the ``web_font_size_report_layout`` directory to your Odoo
59+
addons folder
60+
2. Update the module list from developer mode
61+
3. Search for "Report Font Size in Document Layout" in the app store and
62+
install it.
63+
64+
Usage
65+
=====
66+
67+
Once installed:
68+
69+
1. Go to **Settings → General Settings → Companies → Configure Document
70+
Layout**
71+
2. Locate the new **"Font Size"** field
72+
3. Select your preferred size from the dropdown list
73+
4. Look at Preview or Download PDF Preview
74+
5. Save changes
75+
76+
Bug Tracker
77+
===========
78+
79+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
80+
In case of trouble, please check there if your issue has already been reported.
81+
If you spotted it first, help us to smash it by providing a detailed and welcomed
82+
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_font_size_report_layout%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
83+
84+
Do not contact contributors directly about support or help with technical issues.
85+
86+
Credits
87+
=======
88+
89+
Authors
90+
-------
91+
92+
* Binhex
93+
94+
Contributors
95+
------------
96+
97+
- `Binhex <https://www.binhex.cloud>`__:
98+
- Mario Montes<m.montes@binhex.cloud>
99+
- Abraham J. Febres <afebres@binhex.cloud>
100+
101+
Maintainers
102+
-----------
103+
104+
This module is maintained by the OCA.
105+
106+
.. image:: https://odoo-community.org/logo.png
107+
:alt: Odoo Community Association
108+
:target: https://odoo-community.org
109+
110+
OCA, or the Odoo Community Association, is a nonprofit organization whose
111+
mission is to support the collaborative development of Odoo features and
112+
promote its widespread use.
113+
114+
This module is part of the `OCA/web <https://github.com/OCA/web/tree/18.0/web_font_size_report_layout>`_ project on GitHub.
115+
116+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2025 Binhex
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
{
4+
"name": "Report Font Size in Document Layout",
5+
"version": "18.0.1.1.0",
6+
"summary": "Adds a font size selector (pt) to the Document Layout wizard",
7+
"author": "Binhex," "Odoo Community Association (OCA)",
8+
"website": "https://github.com/OCA/web",
9+
"license": "LGPL-3",
10+
"depends": ["web"],
11+
"data": [
12+
"views/base_document_layout_views.xml",
13+
"views/report_templates_inherit.xml",
14+
],
15+
"assets": {
16+
"web.report_assets_common": [
17+
"web_font_size_report_layout/static/src/scss/report_font_size.scss"
18+
],
19+
"web.report_assets_pdf": [
20+
"web_font_size_report_layout/static/src/scss/report_font_size.scss"
21+
],
22+
},
23+
"installable": True,
24+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import res_company
2+
from . import base_document_layout
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Binhex
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
# web_font_size_report_layout/models/base_document_layout.py
4+
import logging
5+
6+
from odoo import api, fields, models
7+
8+
_logger = logging.getLogger(__name__)
9+
10+
11+
class BaseDocumentLayout(models.TransientModel):
12+
_inherit = "base.document.layout"
13+
14+
report_font_size = fields.Selection(
15+
related="company_id.report_font_size",
16+
readonly=False,
17+
string="Font size",
18+
)
19+
20+
@api.depends("report_font_size")
21+
def _compute_preview(self):
22+
return super()._compute_preview()
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2025 Binhex
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
from odoo import api, fields, models
4+
5+
STYLE_FIELDS = {
6+
"external_report_layout_id",
7+
"font",
8+
"report_font_size",
9+
"primary_color",
10+
"secondary_color",
11+
}
12+
13+
14+
class ResCompany(models.Model):
15+
_inherit = "res.company"
16+
17+
report_font_size = fields.Selection(
18+
selection=[
19+
("9", "9 pt"),
20+
("10", "10 pt"),
21+
("11", "11 pt"),
22+
("12", "12 pt"),
23+
("13", "13 pt"),
24+
("14", "14 pt"),
25+
],
26+
string="Report font size",
27+
default="11",
28+
help="Base font size for PDF content (in points), applied on the external "
29+
"report layout.",
30+
)
31+
32+
@api.model_create_multi
33+
def create(self, vals_list):
34+
companies = super().create(vals_list)
35+
if any(not STYLE_FIELDS.isdisjoint(values) for values in vals_list):
36+
self._update_asset_style()
37+
return companies
38+
39+
def write(self, values):
40+
res = super().write(values)
41+
if not STYLE_FIELDS.isdisjoint(values):
42+
self._update_asset_style()
43+
return res
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [Binhex](https://www.binhex.cloud):
2+
- Mario Montes\<<m.montes@binhex.cloud>\>
3+
- Abraham J. Febres \<<afebres@binhex.cloud>\>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
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.
2+
3+
The module offers the following font size options (in points):
4+
5+
| Option | Size | Description |
6+
|--------|------|-------------|
7+
| Extra Small | 9pt | For maximum compactness |
8+
| Standard | 10pt | Odoo's default size |
9+
| Small | 11pt | Just a little larger |
10+
| Large | 12pt | Better readability |
11+
| Extra Large | 13pt | Really Large |
12+
| 2Extra Large | 14pt | For high visibility needs |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
1. Copy the `web_font_size_report_layout` directory to your Odoo addons folder
2+
2. Update the module list from developer mode
3+
3. Search for "Report Font Size in Document Layout" in the app store and install it.

0 commit comments

Comments
 (0)