-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[18.0][ADD] web_font_size_report_layout: web_font_size_report_layout module added. #3389
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
Open
adasatorres
wants to merge
1
commit into
OCA:18.0
Choose a base branch
from
BinhexTeam:18.0-add-web_font_size_report_layout
base: 18.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.
+920
−0
Open
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,116 @@ | ||
| =================================== | ||
| 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/18.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-18-0/web-18-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=18.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 | ||
| ============ ==== ========================= | ||
| Extra Small 9pt For maximum compactness | ||
| Standard 10pt Odoo's default size | ||
| Small 11pt Just a little larger | ||
| Large 12pt Better readability | ||
| Extra Large 13pt Really Large | ||
| 2Extra 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:%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 | ||
| ------- | ||
|
|
||
| * Binhex | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - `Binhex <https://www.binhex.cloud>`__: | ||
| - Mario Montes<[email protected]> | ||
| - Abraham J. Febres <[email protected]> | ||
|
|
||
| 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/18.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. |
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,24 @@ | ||
| # Copyright 2025 Binhex | ||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
| { | ||
| "name": "Report Font Size in Document Layout", | ||
| "version": "18.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, | ||
| } |
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,2 @@ | ||
| from . import res_company | ||
| from . import base_document_layout |
22 changes: 22 additions & 0 deletions
22
web_font_size_report_layout/models/base_document_layout.py
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 @@ | ||
| # Copyright 2025 Binhex | ||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
| # web_font_size_report_layout/models/base_document_layout.py | ||
| import logging | ||
|
|
||
| from odoo import api, fields, models | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| 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.depends("report_font_size") | ||
| def _compute_preview(self): | ||
| return super()._compute_preview() |
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,43 @@ | ||
| # Copyright 2025 Binhex | ||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
| from odoo import api, fields, models | ||
|
|
||
| STYLE_FIELDS = { | ||
| "external_report_layout_id", | ||
| "font", | ||
| "report_font_size", | ||
| "primary_color", | ||
| "secondary_color", | ||
| } | ||
|
|
||
|
|
||
| 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.", | ||
| ) | ||
|
|
||
adasatorres marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @api.model_create_multi | ||
| def create(self, vals_list): | ||
| companies = super().create(vals_list) | ||
| 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) | ||
| if not STYLE_FIELDS.isdisjoint(values): | ||
| self._update_asset_style() | ||
| return res | ||
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,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
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,3 @@ | ||
| - [Binhex](https://www.binhex.cloud): | ||
| - Mario Montes\<<[email protected]>\> | ||
| - Abraham J. Febres \<<[email protected]>\> |
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,12 @@ | ||
| 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 | | ||
| |--------|------|-------------| | ||
| | Extra Small | 9pt | For maximum compactness | | ||
| | Standard | 10pt | Odoo's default size | | ||
| | Small | 11pt | Just a little larger | | ||
| | Large | 12pt | Better readability | | ||
| | Extra Large | 13pt | Really Large | | ||
| | 2Extra Large | 14pt | For high visibility needs | |
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,3 @@ | ||||||
| 1. Copy the `web_font_size_report_layout` directory to your Odoo addons folder | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks a lot for your module. Here is a suggestion
Suggested change
|
||||||
| 2. Update the module list from developer mode | ||||||
| 3. Search for "Report Font Size in Document Layout" in the app store and install it. | ||||||
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,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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.