Skip to content
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

TA#66805 [16.0][MIG] base_external_report_layout #150

Merged
merged 6 commits into from
Jul 7, 2024
Merged
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
2 changes: 2 additions & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"category": "Other",
"summary": "Install all addons required for testing.",
"depends": [
"base",
"attachment_minio",
"base_external_report_layout",
"lang_fr_activated",
"mail_bot_no_pong",
"mail_notification_no_action_button",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN gitoo install-all --conf_file /gitoo.yml --destination "${THIRD_PARTY_ADDONS
USER odoo

COPY attachment_minio /mnt/extra-addons/attachment_minio
COPY base_external_report_layout /mnt/extra-addons/base_external_report_layout
COPY lang_fr_activated /mnt/extra-addons/lang_fr_activated
COPY mail_bot_no_pong /mnt/extra-addons/mail_bot_no_pong
COPY mail_notification_no_action_button /mnt/extra-addons/mail_notification_no_action_button
Expand Down
22 changes: 22 additions & 0 deletions base_external_report_layout/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
===========================
Base External Report Layout
===========================

.. contents:: Table of Contents

Context
-------
In vanilla Odoo, from the general settings, a many2one layout field allows you to select the layout of Qweb reports.
It allows you to select any view, including views that are not Qweb report layouts.

This field is modified when using the wizard behind 'Configure document layout'. If the user selects a view that is not a layout, then Qweb reports no longer work.

In order to avoid this scenario, this module allows to hide the external report layout field

Overview
--------
After installing this module, the field `external_report_layout_id` is not anymore visible in the general settings view.

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
2 changes: 2 additions & 0 deletions base_external_report_layout/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
16 changes: 16 additions & 0 deletions base_external_report_layout/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{

Check warning on line 4 in base_external_report_layout/__manifest__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

base_external_report_layout/__manifest__.py#L4

Statement seems to have no effect
"name": "Base External Report Layout",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"license": "LGPL-3",
"category": "Base",
"website": "https://www.numigi.com",
"summary": "Hide external report layout from the general settings view",
"depends": ["base_setup"],
"data": ["views/res_config_settings_views.xml"],
"installable": True,
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions base_external_report_layout/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.base.setup</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="0" />
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='company_details_settings']/div[@class='o_setting_right_pane']" position="replace">
<span class="o_form_label">Document Layout</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
<div class="text-muted">
Choose the layout of your documents
</div>
<div class="content-group">
<div class="mt16" groups="base.group_no_one">
<label for="external_report_layout_id" string="Layout" class="col-3 col-lg-3 o_light_label"/>
<field name="external_report_layout_id" domain="[('type','=', 'qweb')]" class="oe_inline"/>
</div>
<div class="mt8">
<button name="%(web.action_base_document_layout_configurator)d" string="Configure Document Layout" type="action" class="oe_link" icon="fa-arrow-right"/>
<button name="edit_external_header" string="Edit Layout" type="object" class="oe_link" groups="base.group_no_one"/>
<button name="%(web.action_report_externalpreview)d" string="Preview Document" type="action" class="oe_link" groups="base.group_no_one"/>
</div>
</div>
</xpath>
</field>
</record>

</odoo>
Loading