diff --git a/.copier-answers.yml b/.copier-answers.yml index 80cdbc8a5c2a..c087986c5865 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -17,7 +17,7 @@ odoo_version: 18.0 org_name: Odoo Community Association (OCA) org_slug: OCA rebel_module_groups: -- web_responsive +- web_responsive,web_responsive_company_color repo_description: web repo_name: web repo_slug: web diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ccdbc5f9922..51cd677c0bdc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,17 +36,17 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest - include: "web_responsive" + include: "web_responsive,web_responsive_company_color" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest - include: "web_responsive" + include: "web_responsive,web_responsive_company_color" name: test with OCB makepot: "true" - container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest - exclude: "web_responsive" + exclude: "web_responsive,web_responsive_company_color" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest - exclude: "web_responsive" + exclude: "web_responsive,web_responsive_company_color" name: test with OCB makepot: "true" services: diff --git a/README.md b/README.md index fb08ae68e94c..f4c20b338046 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ addon | version | maintainers | summary [web_copy_confirm](web_copy_confirm/) | 18.0.1.0.0 | | Show confirmation dialogue before copying records [web_dark_mode](web_dark_mode/) | 18.0.1.0.0 | | Enabled Dark Mode for the Odoo Backend [web_datetime_picker_default_time](web_datetime_picker_default_time/) | 18.0.1.0.0 | grindtildeath | Allows to define a default time on datetime picker -[web_dialog_size](web_dialog_size/) | 18.0.1.0.2 | | A module that lets the user expand a dialog box to the full screen width. +[web_dialog_size](web_dialog_size/) | 18.0.1.0.3 | | A module that lets the user expand a dialog box to the full screen width. [web_disable_export_group](web_disable_export_group/) | 18.0.1.0.0 | | Web Disable Export Group [web_editor_class_selector](web_editor_class_selector/) | 18.0.1.0.0 | carlos-lopez-tecnativa | Web editor class selector [web_editor_disable_chatgpt](web_editor_disable_chatgpt/) | 18.0.1.0.0 | | Web Disable ChatGPT @@ -37,6 +37,7 @@ addon | version | maintainers | summary [web_excel_export_dynamic_expand](web_excel_export_dynamic_expand/) | 18.0.1.0.0 | | Export collapsed groups or the full tree, based on its view. [web_favicon](web_favicon/) | 18.0.1.0.1 | | Allows to set a custom shortcut icon (aka favicon) [web_filter_header_button](web_filter_header_button/) | 18.0.1.0.0 | | Show selected filters as buttons in the control panel +[web_font_size_report_layout](web_font_size_report_layout/) | 18.0.1.0.0 | | Adds a font size selector (pt) to the Document Layout wizard [web_form_banner](web_form_banner/) | 18.0.1.1.0 | | Web Form Banner [web_group_expand](web_group_expand/) | 18.0.1.0.1 | | Group Expand Buttons [web_help](web_help/) | 18.0.1.0.0 | | Help Framework @@ -54,7 +55,8 @@ addon | version | maintainers | summary [web_quick_start_screen](web_quick_start_screen/) | 18.0.1.0.0 | | Configurable start screen for quick actions [web_refresher](web_refresher/) | 18.0.1.0.1 | | Web Refresher [web_remember_tree_column_width](web_remember_tree_column_width/) | 18.0.1.0.2 | frahikLV luisg123v cuongnmtm | Remember the tree columns' widths across sessions. -[web_responsive](web_responsive/) | 18.0.1.0.7 | Tardo SplashS | Responsive web client, community-supported +[web_responsive](web_responsive/) | 18.0.1.0.8 | Tardo SplashS | Responsive web client, community-supported +[web_responsive_company_color](web_responsive_company_color/) | 18.0.1.0.0 | | Styling hooks for web_responsive elements [web_save_discard_button](web_save_discard_button/) | 18.0.1.0.1 | synconics | Save & Discard Buttons [web_search_with_and](web_search_with_and/) | 18.0.1.0.1 | | Use AND conditions on omnibar search [web_send_message_popup](web_send_message_popup/) | 18.0.1.0.0 | | Web Send Message as Popup @@ -79,7 +81,7 @@ addon | version | maintainers | summary [web_widget_o2m_attachment_image_gallery](web_widget_o2m_attachment_image_gallery/) | 18.0.1.0.0 | victoralmau | Widget o2m Attachment Image Gallery Widget [web_widget_one2many_tree_line_duplicate](web_widget_one2many_tree_line_duplicate/) | 18.0.1.0.1 | | Web Widget One2many Tree Line Duplicate [web_widget_open_tab](web_widget_open_tab/) | 18.0.1.0.0 | | Allow to open record from trees on new tab from tree views -[web_widget_pattern](web_widget_pattern/) | 18.0.1.0.0 | hbrunn | Allows to define a regex for validating input on the backend +[web_widget_pattern](web_widget_pattern/) | 18.0.1.0.1 | hbrunn | Allows to define a regex for validating input on the backend [web_widget_popover](web_widget_popover/) | 18.0.1.0.0 | ivantodorovich | Render an icon that displays the field content in a popover [web_widget_product_label_section_and_note_full_label](web_widget_product_label_section_and_note_full_label/) | 18.0.1.0.0 | | Display the full label in the product_label_section_and_note widget. [web_widget_product_label_section_and_note_name_visibility](web_widget_product_label_section_and_note_name_visibility/) | 18.0.1.0.1 | carlos-lopez-tecnativa | Alternate the visibility of the product and description. diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index 769f771bc756..59d5c504385b 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "odoo-addons-oca-web" -version = "18.0.20260721.1" +version = "18.0.20260914.0" dependencies = [ "odoo-addon-web_action_conditionable==18.0.*", "odoo-addon-web_calendar_slot_duration==18.0.*", @@ -17,6 +17,7 @@ dependencies = [ "odoo-addon-web_excel_export_dynamic_expand==18.0.*", "odoo-addon-web_favicon==18.0.*", "odoo-addon-web_filter_header_button==18.0.*", + "odoo-addon-web_font_size_report_layout==18.0.*", "odoo-addon-web_form_banner==18.0.*", "odoo-addon-web_group_expand==18.0.*", "odoo-addon-web_help==18.0.*", @@ -35,6 +36,7 @@ dependencies = [ "odoo-addon-web_refresher==18.0.*", "odoo-addon-web_remember_tree_column_width==18.0.*", "odoo-addon-web_responsive==18.0.*", + "odoo-addon-web_responsive_company_color==18.0.*", "odoo-addon-web_save_discard_button==18.0.*", "odoo-addon-web_search_with_and==18.0.*", "odoo-addon-web_send_message_popup==18.0.*", diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst index 8d0caa21b843..8e2581e53f20 100644 --- a/web_dialog_size/README.rst +++ b/web_dialog_size/README.rst @@ -11,7 +11,7 @@ Web Dialog Size !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ef5e339b0accce605dac153ffd572aaf492759d0a6a2b91a27b51e4c3d1ee5d1 + !! source digest: sha256:a306b45986bf786b971c49a98fb0d1a7af7ca0317b0eee223c5bb7bf8505d836 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py index 3898a5f82284..86d6955bf95f 100644 --- a/web_dialog_size/__manifest__.py +++ b/web_dialog_size/__manifest__.py @@ -15,7 +15,7 @@ "Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", "category": "web", - "version": "18.0.1.0.2", + "version": "18.0.1.0.3", "license": "AGPL-3", "depends": ["web"], "installable": True, diff --git a/web_dialog_size/static/description/index.html b/web_dialog_size/static/description/index.html index e1422c84b95c..de66368f3edb 100644 --- a/web_dialog_size/static/description/index.html +++ b/web_dialog_size/static/description/index.html @@ -372,7 +372,7 @@

Web Dialog Size

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

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

A module that lets the user expand/restore the dialog box size through a diff --git a/web_dialog_size/static/src/js/web_dialog_size.esm.js b/web_dialog_size/static/src/js/web_dialog_size.esm.js index 378cca3a1601..e8753bef19cc 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.esm.js +++ b/web_dialog_size/static/src/js/web_dialog_size.esm.js @@ -5,6 +5,12 @@ import {SelectCreateDialog} from "@web/views/view_dialogs/select_create_dialog"; import {patch} from "@web/core/utils/patch"; import {useService} from "@web/core/utils/hooks"; +function triggerWindowResize() { + requestAnimationFrame(() => { + window.dispatchEvent(new Event("resize")); + }); +} + export class ExpandButton extends Component { setup() { this.orm = useService("orm"); @@ -30,12 +36,12 @@ export class ExpandButton extends Component { dialog_button_extend() { this.props.setsize("dialog_full_screen"); - this.render(); + triggerWindowResize(); } dialog_button_restore() { this.props.setsize(this.last_size); - this.render(); + triggerWindowResize(); } } diff --git a/web_font_size_report_layout/README.rst b/web_font_size_report_layout/README.rst new file mode 100644 index 000000000000..e847611a8055 --- /dev/null +++ b/web_font_size_report_layout/README.rst @@ -0,0 +1,120 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=================================== +Report Font Size in Document Layout +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:447018d8824e5466aff37ee61db85e01f7097cee1bd4b2db048814e001f99ca4 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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. Link 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 `_. +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Binhex + +Contributors +------------ + +- `Binhex `__: +- Mario Montes +- Abraham J. Febres + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_font_size_report_layout/__init__.py b/web_font_size_report_layout/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/web_font_size_report_layout/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/web_font_size_report_layout/__manifest__.py b/web_font_size_report_layout/__manifest__.py new file mode 100644 index 000000000000..61d1a4d26a81 --- /dev/null +++ b/web_font_size_report_layout/__manifest__.py @@ -0,0 +1,22 @@ +{ + "name": "Report Font Size in Document Layout", + "version": "18.0.1.0.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, +} diff --git a/web_font_size_report_layout/i18n/it.po b/web_font_size_report_layout/i18n/it.po new file mode 100644 index 000000000000..b414d3ff365c --- /dev/null +++ b/web_font_size_report_layout/i18n/it.po @@ -0,0 +1,105 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_font_size_report_layout +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-03-11 12:09+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__10 +msgid "10 pt" +msgstr "10 pt" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__11 +msgid "11 pt" +msgstr "11 pt" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__12 +msgid "12 pt" +msgstr "12 pt" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__13 +msgid "13 pt" +msgstr "13 pt" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__14 +msgid "14 pt" +msgstr "14 pt" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__9 +msgid "9 pt" +msgstr "9 pt" + +#. module: web_font_size_report_layout +#: model:ir.model.fields,help:web_font_size_report_layout.field_base_document_layout__report_font_size +#: model:ir.model.fields,help:web_font_size_report_layout.field_res_company__report_font_size +msgid "" +"Base font size for PDF content (in points), applied on the external report " +"layout." +msgstr "" +"Dimensione carattere base per il contenuto del PDF (in punti), applicata " +"allo schema esterno del resoconto." + +#. module: web_font_size_report_layout +#: model:ir.model,name:web_font_size_report_layout.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: web_font_size_report_layout +#: model:ir.model,name:web_font_size_report_layout.model_base_document_layout +msgid "Company Document Layout" +msgstr "Schema documento azienda" + +#. module: web_font_size_report_layout +#: model:ir.model.fields,field_description:web_font_size_report_layout.field_base_document_layout__report_font_size +msgid "Font size" +msgstr "Dimensione carattere" + +#. module: web_font_size_report_layout +#: model:ir.model.fields,field_description:web_font_size_report_layout.field_res_company__report_font_size +msgid "Report font size" +msgstr "Dimensione carattere resoconto" + +#. module: web_font_size_report_layout +#: model_terms:ir.ui.view,arch_db:web_font_size_report_layout.styles_company_report_global_fontsize +msgid "" +"body, .o_report_layout, .page,\n" +" .o_report_layout *, .page *,\n" +" table, td, th, p, li, span, div {\n" +" font-size:" +msgstr "" +"body, .o_report_layout, .page,\n" +" .o_report_layout *, .page *,\n" +" table, td, th, p, li, span, div {\n" +" font-size:" + +#. module: web_font_size_report_layout +#: model_terms:ir.ui.view,arch_db:web_font_size_report_layout.styles_company_report_global_fontsize +msgid "" +"pt !important;\n" +" }\n" +" .o_report_layout h1, .page h1 { font-size: 1.6em !important; }\n" +" .o_report_layout h2, .page h2 { font-size: 1.3em !important; }\n" +" .o_report_layout h3, .page h3 { font-size: 1.15em !important; }" +msgstr "" +"pt !important;\n" +" }\n" +" .o_report_layout h1, .page h1 { font-size: 1.6em !important; }\n" +" .o_report_layout h2, .page h2 { font-size: 1.3em !important; }\n" +" .o_report_layout h3, .page h3 { font-size: 1.15em !important; }" diff --git a/web_font_size_report_layout/i18n/web_font_size_report_layout.pot b/web_font_size_report_layout/i18n/web_font_size_report_layout.pot new file mode 100644 index 000000000000..13e9b8e45007 --- /dev/null +++ b/web_font_size_report_layout/i18n/web_font_size_report_layout.pot @@ -0,0 +1,91 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_font_size_report_layout +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__10 +msgid "10 pt" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__11 +msgid "11 pt" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__12 +msgid "12 pt" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__13 +msgid "13 pt" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__14 +msgid "14 pt" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields.selection,name:web_font_size_report_layout.selection__res_company__report_font_size__9 +msgid "9 pt" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields,help:web_font_size_report_layout.field_base_document_layout__report_font_size +#: model:ir.model.fields,help:web_font_size_report_layout.field_res_company__report_font_size +msgid "" +"Base font size for PDF content (in points), applied on the external report " +"layout." +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model,name:web_font_size_report_layout.model_res_company +msgid "Companies" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model,name:web_font_size_report_layout.model_base_document_layout +msgid "Company Document Layout" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields,field_description:web_font_size_report_layout.field_base_document_layout__report_font_size +msgid "Font size" +msgstr "" + +#. module: web_font_size_report_layout +#: model:ir.model.fields,field_description:web_font_size_report_layout.field_res_company__report_font_size +msgid "Report font size" +msgstr "" + +#. module: web_font_size_report_layout +#: model_terms:ir.ui.view,arch_db:web_font_size_report_layout.styles_company_report_global_fontsize +msgid "" +"body, .o_report_layout, .page,\n" +" .o_report_layout *, .page *,\n" +" table, td, th, p, li, span, div {\n" +" font-size:" +msgstr "" + +#. module: web_font_size_report_layout +#: model_terms:ir.ui.view,arch_db:web_font_size_report_layout.styles_company_report_global_fontsize +msgid "" +"pt !important;\n" +" }\n" +" .o_report_layout h1, .page h1 { font-size: 1.6em !important; }\n" +" .o_report_layout h2, .page h2 { font-size: 1.3em !important; }\n" +" .o_report_layout h3, .page h3 { font-size: 1.15em !important; }" +msgstr "" diff --git a/web_font_size_report_layout/models/__init__.py b/web_font_size_report_layout/models/__init__.py new file mode 100644 index 000000000000..290c7e13846b --- /dev/null +++ b/web_font_size_report_layout/models/__init__.py @@ -0,0 +1,2 @@ +from . import res_company +from . import base_document_layout diff --git a/web_font_size_report_layout/models/base_document_layout.py b/web_font_size_report_layout/models/base_document_layout.py new file mode 100644 index 000000000000..48e48aa2f61e --- /dev/null +++ b/web_font_size_report_layout/models/base_document_layout.py @@ -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() diff --git a/web_font_size_report_layout/models/res_company.py b/web_font_size_report_layout/models/res_company.py new file mode 100644 index 000000000000..0a0b121c5d09 --- /dev/null +++ b/web_font_size_report_layout/models/res_company.py @@ -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.", + ) + + @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 diff --git a/web_font_size_report_layout/pyproject.toml b/web_font_size_report_layout/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_font_size_report_layout/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_font_size_report_layout/readme/CONTRIBUTORS.md b/web_font_size_report_layout/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..f796d63ad965 --- /dev/null +++ b/web_font_size_report_layout/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Binhex](https://www.binhex.cloud): +- Mario Montes\<\> +- Abraham J. Febres \<\> diff --git a/web_font_size_report_layout/readme/DESCRIPTION.md b/web_font_size_report_layout/readme/DESCRIPTION.md new file mode 100644 index 000000000000..e06642cb2216 --- /dev/null +++ b/web_font_size_report_layout/readme/DESCRIPTION.md @@ -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 | diff --git a/web_font_size_report_layout/readme/INSTALL.md b/web_font_size_report_layout/readme/INSTALL.md new file mode 100644 index 000000000000..d79449871ac7 --- /dev/null +++ b/web_font_size_report_layout/readme/INSTALL.md @@ -0,0 +1,3 @@ +1. Link 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. diff --git a/web_font_size_report_layout/readme/USAGE.md b/web_font_size_report_layout/readme/USAGE.md new file mode 100644 index 000000000000..cf1e758aaa01 --- /dev/null +++ b/web_font_size_report_layout/readme/USAGE.md @@ -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 diff --git a/web_font_size_report_layout/static/description/icon.png b/web_font_size_report_layout/static/description/icon.png new file mode 100644 index 000000000000..1dcc49c24f36 Binary files /dev/null and b/web_font_size_report_layout/static/description/icon.png differ diff --git a/web_font_size_report_layout/static/description/index.html b/web_font_size_report_layout/static/description/index.html new file mode 100644 index 000000000000..4691debfc2f2 --- /dev/null +++ b/web_font_size_report_layout/static/description/index.html @@ -0,0 +1,499 @@ + + + + + +README.rst + + + +

+ + + +Odoo Community Association + +
+

Report Font Size in Document Layout

+ +

Beta License: LGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

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):

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionSizeDescription
Extra Small9ptFor maximum compactness
Standard10ptOdoo’s default size
Small11ptJust a little larger
Large12ptBetter readability
Extra Large13ptReally Large
2Extra Large14ptFor high visibility needs
+

Table of contents

+ +
+

Installation

+
    +
  1. Link the web_font_size_report_layout directory to your Odoo +addons folder
  2. +
  3. Update the module list from developer mode
  4. +
  5. Search for “Report Font Size in Document Layout” in the app store and +install it.
  6. +
+
+
+

Usage

+

Once installed:

+
    +
  1. Go to Settings → General Settings → Companies → Configure Document +Layout
  2. +
  3. Locate the new “Font Size” field
  4. +
  5. Select your preferred size from the dropdown list
  6. +
  7. Look at Preview or Download PDF Preview
  8. +
  9. Save changes
  10. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Binhex
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/web_font_size_report_layout/static/src/scss/report_font_size.scss b/web_font_size_report_layout/static/src/scss/report_font_size.scss new file mode 100644 index 000000000000..3aa60f231e11 --- /dev/null +++ b/web_font_size_report_layout/static/src/scss/report_font_size.scss @@ -0,0 +1,15 @@ +/* Valor por defecto en pt */ +:root { + --report-font-size: 11pt; +} + +/* Aplica al wrapper típico y a .page (usado por algunos informes) */ +.o_report_layout, +.page { + font-size: var(--report-font-size) !important; +} + +.o_report_layout *, +.page * { + font-size: inherit !important; +} diff --git a/web_font_size_report_layout/tests/__init__.py b/web_font_size_report_layout/tests/__init__.py new file mode 100644 index 000000000000..40bb8ad1eeba --- /dev/null +++ b/web_font_size_report_layout/tests/__init__.py @@ -0,0 +1 @@ +from . import test_company_font_size diff --git a/web_font_size_report_layout/tests/test_company_font_size.py b/web_font_size_report_layout/tests/test_company_font_size.py new file mode 100644 index 000000000000..4c7df5ca5c48 --- /dev/null +++ b/web_font_size_report_layout/tests/test_company_font_size.py @@ -0,0 +1,47 @@ +from odoo.tests.common import TransactionCase, tagged + + +@tagged("post_install", "-at_install") +class TestCompanyFontSize(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.Company = cls.env["res.company"] + + def test_default_and_selection_values(self): + co = self.Company.create({"name": "Co A"}) + self.assertEqual(co.report_font_size, "11") + co.report_font_size = "9" + self.assertEqual(co.report_font_size, "9") + + def test_create_with_explicit_font_size_persists(self): + co = self.Company.create({"name": "Co B", "report_font_size": "12"}) + self.assertEqual(co.report_font_size, "12") + + def test_write_only_style_field_is_safe(self): + co = self.Company.create({"name": "Co C"}) + co.write({"report_font_size": "14"}) + self.assertEqual(co.report_font_size, "14") + + def test_write_unrelated_fields_dont_affect_font_size(self): + co = self.Company.create({"name": "Co D"}) + old = co.report_font_size + co.write({"email": "x@example.com"}) + self.assertEqual(co.report_font_size, old) + + def test_multi_company_independence(self): + co1 = self.Company.create({"name": "Co E"}) + co2 = self.Company.create({"name": "Co F"}) + co1.write({"report_font_size": "9"}) + co2.write({"report_font_size": "14"}) + self.assertEqual(co1.report_font_size, "9") + self.assertEqual(co2.report_font_size, "14") + + def test_multiple_changes_persist_in_sequence(self): + co = self.Company.create({"name": "Co G"}) + co.write({"report_font_size": "14"}) + self.assertEqual(co.report_font_size, "14") + co.write({"report_font_size": "10"}) + self.assertEqual(co.report_font_size, "10") + co.write({"report_font_size": "12"}) + self.assertEqual(co.report_font_size, "12") diff --git a/web_font_size_report_layout/views/base_document_layout_views.xml b/web_font_size_report_layout/views/base_document_layout_views.xml new file mode 100644 index 000000000000..ef4b5af1d87d --- /dev/null +++ b/web_font_size_report_layout/views/base_document_layout_views.xml @@ -0,0 +1,14 @@ + + + + base.document.layout.font.size + base.document.layout + + 50 + + + + + + + diff --git a/web_font_size_report_layout/views/report_templates_inherit.xml b/web_font_size_report_layout/views/report_templates_inherit.xml new file mode 100644 index 000000000000..120935836b6f --- /dev/null +++ b/web_font_size_report_layout/views/report_templates_inherit.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + diff --git a/web_responsive/README.rst b/web_responsive/README.rst index a080dbd16a41..69dc22b93f86 100644 --- a/web_responsive/README.rst +++ b/web_responsive/README.rst @@ -11,7 +11,7 @@ Web Responsive !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ebe111b566ba52389e9ade067a40de491ca4da8f07eb96a66719d55c05d6fd58 + !! source digest: sha256:e119f248ecb98473e7141eb27ac6c6eba437e5139e0e87a726fa5c0a4a4c6392 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/web_responsive/__manifest__.py b/web_responsive/__manifest__.py index 5fc2721b92b8..b7860572a48a 100644 --- a/web_responsive/__manifest__.py +++ b/web_responsive/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Web Responsive", "summary": "Responsive web client, community-supported", - "version": "18.0.1.0.7", + "version": "18.0.1.0.8", "category": "Website", "website": "https://github.com/OCA/web", "author": "LasLabs, Tecnativa, ITerra, Onestein, " diff --git a/web_responsive/static/description/index.html b/web_responsive/static/description/index.html index 61d5a9f83aac..837fef2d745a 100644 --- a/web_responsive/static/description/index.html +++ b/web_responsive/static/description/index.html @@ -372,7 +372,7 @@

Web Responsive

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

Production/Stable License: LGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module adds responsiveness to web backend.

diff --git a/web_responsive/static/src/components/apps_menu_item/apps_menu_item.esm.js b/web_responsive/static/src/components/apps_menu_item/apps_menu_item.esm.js index de8ef526aab1..50930ac3944f 100644 --- a/web_responsive/static/src/components/apps_menu_item/apps_menu_item.esm.js +++ b/web_responsive/static/src/components/apps_menu_item/apps_menu_item.esm.js @@ -31,7 +31,8 @@ export class AppMenuItem extends Component { this.webIconData = getWebIconData(nextProps.app); } - onClick() { + onClick(ev) { + ev.preventDefault(); if (typeof this.props.onClick === "function") { this.props.onClick(this.props.app); } diff --git a/web_responsive_company_color/README.rst b/web_responsive_company_color/README.rst new file mode 100644 index 000000000000..a99dea7698ff --- /dev/null +++ b/web_responsive_company_color/README.rst @@ -0,0 +1,93 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================ +Web Responsive Company Color +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1c7b508d406e3751ab0d89e6e2cd56c4f5d6a40d19b8aef5b51e575aa75b75fd + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/18.0/web_responsive_company_color + :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_responsive_company_color + :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 module bridges web_company_color with web_responsive. + +With this module, elements introduced or modified by web_responsive can +be styled with the same logic as web_company_color. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Simply install the app. See web_company_color for instructions on how to +customize colors. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Anusri Veerappan Prakasam + +Contributors +------------ + +- `PyTech `__: + + - Alessandro Uffreduzzi + - Anusri Veerappan Prakasam + - Simone Rubino + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_responsive_company_color/__init__.py b/web_responsive_company_color/__init__.py new file mode 100644 index 000000000000..1a9a001cf76a --- /dev/null +++ b/web_responsive_company_color/__init__.py @@ -0,0 +1,2 @@ +from . import models +from .hooks import post_init_hook, uninstall_hook diff --git a/web_responsive_company_color/__manifest__.py b/web_responsive_company_color/__manifest__.py new file mode 100644 index 000000000000..14a332741b74 --- /dev/null +++ b/web_responsive_company_color/__manifest__.py @@ -0,0 +1,18 @@ +{ + "name": "Web Responsive Company Color", + "summary": "Styling hooks for web_responsive elements", + "license": "AGPL-3", + "author": "Anusri Veerappan Prakasam, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "category": "Web", + "version": "18.0.1.0.0", + "depends": [ + "web_company_color", + "web_responsive", + ], + "data": [], + "post_init_hook": "post_init_hook", + "uninstall_hook": "uninstall_hook", + "installable": True, + "application": False, +} diff --git a/web_responsive_company_color/hooks.py b/web_responsive_company_color/hooks.py new file mode 100644 index 000000000000..d958c528a90f --- /dev/null +++ b/web_responsive_company_color/hooks.py @@ -0,0 +1,8 @@ +def uninstall_hook(env): + env["res.company"].with_context(uninstall_scss=True).search( + [] + ).scss_create_or_update_attachment() + + +def post_init_hook(env): + env["res.company"].search([]).scss_create_or_update_attachment() diff --git a/web_responsive_company_color/i18n/it.po b/web_responsive_company_color/i18n/it.po new file mode 100644 index 000000000000..85891473e200 --- /dev/null +++ b/web_responsive_company_color/i18n/it.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_responsive_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-09-10 10:41+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: web_responsive_company_color +#: model:ir.model,name:web_responsive_company_color.model_res_company +msgid "Companies" +msgstr "Aziende" diff --git a/web_responsive_company_color/i18n/web_responsive_company_color.pot b/web_responsive_company_color/i18n/web_responsive_company_color.pot new file mode 100644 index 000000000000..699113fcdfd6 --- /dev/null +++ b/web_responsive_company_color/i18n/web_responsive_company_color.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_responsive_company_color +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_responsive_company_color +#: model:ir.model,name:web_responsive_company_color.model_res_company +msgid "Companies" +msgstr "" diff --git a/web_responsive_company_color/models/__init__.py b/web_responsive_company_color/models/__init__.py new file mode 100644 index 000000000000..aff44f335ae6 --- /dev/null +++ b/web_responsive_company_color/models/__init__.py @@ -0,0 +1 @@ +from . import res_company diff --git a/web_responsive_company_color/models/res_company.py b/web_responsive_company_color/models/res_company.py new file mode 100644 index 000000000000..c9c37b65e355 --- /dev/null +++ b/web_responsive_company_color/models/res_company.py @@ -0,0 +1,26 @@ +from odoo import models + + +class ResCompany(models.Model): + _inherit = "res.company" + + # For customizations of new web elements included + # under _get_scss_template to take effect, one need + # to handle migration to invoke post_init_hook() + def _get_scss_template(self): + uninstall_scss = self._context.get("uninstall_scss", False) + if not uninstall_scss: + return ( + super()._get_scss_template() + + """ +.app-menu-container { + background: url('/web_responsive/static/src/img/home-menu-bg-overlay.svg'), + linear-gradient( + to bottom, + %(color_navbar_bg)s, + desaturate(lighten(%(color_navbar_bg)s, 20%%), 15) + ); +} + """ + ) + return super()._get_scss_template() diff --git a/web_responsive_company_color/pyproject.toml b/web_responsive_company_color/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_responsive_company_color/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_responsive_company_color/readme/CONTRIBUTORS.md b/web_responsive_company_color/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..2453337cb575 --- /dev/null +++ b/web_responsive_company_color/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- [PyTech](https://www.pytech.it): + - Alessandro Uffreduzzi \ + - Anusri Veerappan Prakasam \ + - Simone Rubino \ diff --git a/web_responsive_company_color/readme/DESCRIPTION.md b/web_responsive_company_color/readme/DESCRIPTION.md new file mode 100644 index 000000000000..c7d4b2bd9dd8 --- /dev/null +++ b/web_responsive_company_color/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module bridges web_company_color with web_responsive. + +With this module, elements introduced or modified by web_responsive can +be styled with the same logic as web_company_color. diff --git a/web_responsive_company_color/readme/USAGE.md b/web_responsive_company_color/readme/USAGE.md new file mode 100644 index 000000000000..9ca0cdc8eee2 --- /dev/null +++ b/web_responsive_company_color/readme/USAGE.md @@ -0,0 +1,2 @@ +Simply install the app. See web_company_color for instructions on how to +customize colors. diff --git a/web_responsive_company_color/static/description/icon.png b/web_responsive_company_color/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/web_responsive_company_color/static/description/icon.png differ diff --git a/web_responsive_company_color/static/description/index.html b/web_responsive_company_color/static/description/index.html new file mode 100644 index 000000000000..fb4e68d3f039 --- /dev/null +++ b/web_responsive_company_color/static/description/index.html @@ -0,0 +1,442 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Web Responsive Company Color

+ +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This module bridges web_company_color with web_responsive.

+

With this module, elements introduced or modified by web_responsive can +be styled with the same logic as web_company_color.

+

Table of contents

+ +
+

Usage

+

Simply install the app. See web_company_color for instructions on how to +customize colors.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Anusri Veerappan Prakasam
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/web_responsive_company_color/tests/__init__.py b/web_responsive_company_color/tests/__init__.py new file mode 100644 index 000000000000..c3b634b71adb --- /dev/null +++ b/web_responsive_company_color/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_res_company diff --git a/web_responsive_company_color/tests/test_res_company.py b/web_responsive_company_color/tests/test_res_company.py new file mode 100644 index 000000000000..4afb773cf443 --- /dev/null +++ b/web_responsive_company_color/tests/test_res_company.py @@ -0,0 +1,28 @@ +# Copyright 2025 Simone Rubino - PyTech +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +import base64 + +from odoo.addons.base.tests.common import BaseCommon + + +class TestResCompany(BaseCommon): + def test_compiled_scss(self): + """The SCSS is compiled before being sent to the client.""" + # Arrange + company = self.env.company + color = "#d2e1dd" + result_color = "white" + company.color_navbar_bg = color + + # Act + company.scss_create_or_update_attachment() + + # Assert + attachment = self.env["ir.attachment"].search( + [("url", "=", company.scss_get_url())] + ) + css = base64.b64decode(attachment.datas).decode() + self.assertNotIn("desaturate(", css) + self.assertNotIn("lighten(", css) + self.assertIn(f"linear-gradient(to bottom, {color}, {result_color})", css) diff --git a/web_widget_pattern/README.rst b/web_widget_pattern/README.rst index 2e6180b71aa9..c705d868e25c 100644 --- a/web_widget_pattern/README.rst +++ b/web_widget_pattern/README.rst @@ -11,7 +11,7 @@ Input patterns !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:21932e96cfc766cc998edb038c99dd2ca5899c78dba5ee6ebf426df169e2c3ee + !! source digest: sha256:f9595c1e5efbcc635e11f6dd7dba580e33c02cbe2d0dca133b75aa319bf90e6c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png diff --git a/web_widget_pattern/__manifest__.py b/web_widget_pattern/__manifest__.py index 0742753df691..7d2172146e29 100644 --- a/web_widget_pattern/__manifest__.py +++ b/web_widget_pattern/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Input patterns", "summary": "Allows to define a regex for validating input on the backend", - "version": "18.0.1.0.0", + "version": "18.0.1.0.1", "development_status": "Alpha", "category": "Technical", "website": "https://github.com/OCA/web", diff --git a/web_widget_pattern/static/description/index.html b/web_widget_pattern/static/description/index.html index 56dbf6a987e7..cfe6b66b48a2 100644 --- a/web_widget_pattern/static/description/index.html +++ b/web_widget_pattern/static/description/index.html @@ -372,7 +372,7 @@

Input patterns

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:21932e96cfc766cc998edb038c99dd2ca5899c78dba5ee6ebf426df169e2c3ee +!! source digest: sha256:f9595c1e5efbcc635e11f6dd7dba580e33c02cbe2d0dca133b75aa319bf90e6c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Alpha License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module allows to use diff --git a/web_widget_pattern/tests/test_web_widget_pattern.py b/web_widget_pattern/tests/test_web_widget_pattern.py index 222eb9d61895..21063a91c763 100644 --- a/web_widget_pattern/tests/test_web_widget_pattern.py +++ b/web_widget_pattern/tests/test_web_widget_pattern.py @@ -1,7 +1,10 @@ # Copyright 2024 Hunki Enterprises BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) -from odoo.tests.common import HttpCase, TransactionCase, tagged +import odoo +from odoo.tests.common import TransactionCase + +from odoo.addons.web.tests.test_js import WebSuite class TestWebWidgetPattern(TransactionCase): @@ -14,14 +17,11 @@ def test_fields_get(self): self.assertEqual(field_description["pattern"], "[0-9]") -@tagged("post_install", "-at_install") -class TestWebWidgetPatternHoot(HttpCase): - def test_js(self): - self.browser_js( - "/web/tests?headless&loglevel=2&preset=desktop&filter=WebWidgetPattern", - "", - "", - login="admin", - success_signal="[HOOT] Test suite succeeded", - error_checker=lambda x: "[HOOT]" not in x, - ) +@odoo.tests.tagged("post_install", "-at_install") +class TestWebWidgetPatternHoot(WebSuite): + def get_hoot_filters(self): + self._test_params = [("+", "@web_widget_pattern")] + return super().get_hoot_filters() + + def test_web_widget_pattern(self): + self.test_unit_desktop()