diff --git a/README.md b/README.md index 4c02325e5d33..cbc2499dd69c 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- +[web_dialog_size](web_dialog_size/) | 18.0.1.0.0 | | A module that lets the user expand a dialog box to the full screen width. [web_environment_ribbon](web_environment_ribbon/) | 18.0.1.0.1 | | Web Environment Ribbon [web_favicon](web_favicon/) | 18.0.1.0.0 | | Allows to set a custom shortcut icon (aka favicon) [web_no_bubble](web_no_bubble/) | 18.0.1.0.0 | | Remove the bubbles from the web interface diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index dc32cfccf688..3f664d504509 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,7 +1,8 @@ [project] name = "odoo-addons-oca-web" -version = "18.0.20250114.0" +version = "18.0.20250206.0" dependencies = [ + "odoo-addon-web_dialog_size==18.0.*", "odoo-addon-web_environment_ribbon==18.0.*", "odoo-addon-web_favicon==18.0.*", "odoo-addon-web_no_bubble==18.0.*", diff --git a/web_dialog_size/README.rst b/web_dialog_size/README.rst new file mode 100644 index 000000000000..9e7bb197c4f1 --- /dev/null +++ b/web_dialog_size/README.rst @@ -0,0 +1,115 @@ +=============== +Web Dialog Size +=============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:6e8cbde132eca54a0b756ffe2922edfe7b701ea5400063603cba71aa0e4de87d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-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_dialog_size + :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_dialog_size + :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| + +A module that lets the user expand/restore the dialog box size through a +button in the upper right corner (imitating most windows managers). It +also adds draggable support to the dialogs. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +By default, the module respects the caller's ``dialog_size`` option. If +you want to set dialog boxes maximized by default, you need to: + +1. Go to *Settings -> Technical -> Parameters -> System Parameters* + +2. | Add a new record with the text *web_dialog_size.default_maximize* + in + | the *Key* field and the text *True* in the *Value* field + +Known issues / Roadmap +====================== + +- Allow setting default dialog size per user. + +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 +------- + +* ACSONE SA/NV +* Therp BV +* Siddharth Bhalgami +* Tecnativa +* Amaris + +Contributors +------------ + +- Anthony Muschang +- Stéphane Bidoul +- Holger Brunn +- Siddharth Bhalgami +- Wolfgang Pichler +- David Vidal +- Quentin Theuret +- `Tecnativa `__: + + - Pedro M. Baeza + - Jairo Llopis + - Ernesto Tejeda + - Carlos Roca + +- Sudhir Arya +- Pierre Pizzetta +- Mantas Šniukas + +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_dialog_size/__init__.py b/web_dialog_size/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/web_dialog_size/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/web_dialog_size/__manifest__.py b/web_dialog_size/__manifest__.py new file mode 100644 index 000000000000..baac404f3c98 --- /dev/null +++ b/web_dialog_size/__manifest__.py @@ -0,0 +1,39 @@ +# Copyright 2015 ACSONE SA/NV +# Copyright 2018 Amaris +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Dialog Size", + "summary": """ + A module that lets the user expand a + dialog box to the full screen width.""", + "author": "ACSONE SA/NV, " + "Therp BV, " + "Siddharth Bhalgami," + "Tecnativa, " + "Amaris, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "category": "web", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "depends": ["web"], + "installable": True, + "assets": { + "web.assets_backend": [ + "/web_dialog_size/static/src/js/web_dialog_size.esm.js", + "/web_dialog_size/static/src/scss/web_dialog_size.scss", + "/web_dialog_size/static/src/xml/ExpandButton.xml", + ( + "after", + "/web/static/src/core/dialog/dialog.xml", + "/web_dialog_size/static/src/xml/web_dialog_header.xml", + ), + ( + "after", + "/web/static/src/views/view_dialogs/select_create_dialog.xml", + "/web_dialog_size/static/src/xml/select_create_dialog.xml", + ), + ], + }, +} diff --git a/web_dialog_size/i18n/de.po b/web_dialog_size/i18n/de.po new file mode 100644 index 000000000000..3a7e405c3227 --- /dev/null +++ b/web_dialog_size/i18n/de.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-10-13 20:46+0000\n" +"Last-Translator: Corneliuus \n" +"Language-Team: none\n" +"Language: de\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 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Systemparameter" + +#~ msgid "Display Name" +#~ msgstr "Anzeigename" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Zuletzt bearbeitet am" diff --git a/web_dialog_size/i18n/es.po b/web_dialog_size/i18n/es.po new file mode 100644 index 000000000000..a3647c364aad --- /dev/null +++ b/web_dialog_size/i18n/es.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-25 11:47+0000\n" +"Last-Translator: Valentin Vinagre \n" +"Language-Team: none\n" +"Language: es\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 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Parámetro del sistema" + +#~ msgid "ID" +#~ msgstr "ID" diff --git a/web_dialog_size/i18n/fr.po b/web_dialog_size/i18n/fr.po new file mode 100644 index 000000000000..d3a0bde37860 --- /dev/null +++ b/web_dialog_size/i18n/fr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-14 20:47+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: none\n" +"Language: fr\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 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Paramètre système" + +#~ msgid "Display Name" +#~ msgstr "Nom affiché" diff --git a/web_dialog_size/i18n/it.po b/web_dialog_size/i18n/it.po new file mode 100644 index 000000000000..b54cc337a46b --- /dev/null +++ b/web_dialog_size/i18n/it.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:33+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 4.17\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Parametro di sistema" + +#~ msgid "Display Name" +#~ msgstr "Nome Visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima Modifica il" diff --git a/web_dialog_size/i18n/nl.po b/web_dialog_size/i18n/nl.po new file mode 100644 index 000000000000..d90fc964ebbe --- /dev/null +++ b/web_dialog_size/i18n/nl.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-17 20:47+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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 4.3.2\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "Systeem Parameter" + +#~ msgid "Display Name" +#~ msgstr "Weergavenaam" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Laatst Gewijzigd op" diff --git a/web_dialog_size/i18n/web_dialog_size.pot b/web_dialog_size/i18n/web_dialog_size.pot new file mode 100644 index 000000000000..6aa3168b24a8 --- /dev/null +++ b/web_dialog_size/i18n/web_dialog_size.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +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_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "" diff --git a/web_dialog_size/i18n/zh_CN.po b/web_dialog_size/i18n/zh_CN.po new file mode 100644 index 000000000000..8a3c4118d4b9 --- /dev/null +++ b/web_dialog_size/i18n/zh_CN.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_dialog_size +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 12:52+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_dialog_size +#: model:ir.model,name:web_dialog_size.model_ir_config_parameter +msgid "System Parameter" +msgstr "系统参数" diff --git a/web_dialog_size/models/__init__.py b/web_dialog_size/models/__init__.py new file mode 100644 index 000000000000..bd3aa9f10636 --- /dev/null +++ b/web_dialog_size/models/__init__.py @@ -0,0 +1 @@ +from . import ir_config_parameter diff --git a/web_dialog_size/models/ir_config_parameter.py b/web_dialog_size/models/ir_config_parameter.py new file mode 100644 index 000000000000..493a4f6fb251 --- /dev/null +++ b/web_dialog_size/models/ir_config_parameter.py @@ -0,0 +1,18 @@ +# Copyright 2018 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.models import Model, api +from odoo.tools.safe_eval import const_eval + + +class IrConfigParameter(Model): + _inherit = "ir.config_parameter" + + @api.model + def get_web_dialog_size_config(self): + get_param = self.sudo().get_param + return { + "default_maximize": const_eval( + get_param("web_dialog_size.default_maximize", "False") + ) + } diff --git a/web_dialog_size/pyproject.toml b/web_dialog_size/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_dialog_size/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_dialog_size/readme/CONFIGURE.md b/web_dialog_size/readme/CONFIGURE.md new file mode 100644 index 000000000000..7626410d58d7 --- /dev/null +++ b/web_dialog_size/readme/CONFIGURE.md @@ -0,0 +1,7 @@ +By default, the module respects the caller's `dialog_size` option. If +you want to set dialog boxes maximized by default, you need to: + +1. Go to *Settings -\> Technical -\> Parameters -\> System Parameters* + +2. Add a new record with the text *web_dialog_size.default_maximize* in + the *Key* field and the text *True* in the *Value* field diff --git a/web_dialog_size/readme/CONTRIBUTORS.md b/web_dialog_size/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..8b9a9b08cd77 --- /dev/null +++ b/web_dialog_size/readme/CONTRIBUTORS.md @@ -0,0 +1,15 @@ +- Anthony Muschang \<\> +- Stéphane Bidoul \<\> +- Holger Brunn \<\> +- Siddharth Bhalgami \<\> +- Wolfgang Pichler \<\> +- David Vidal \<\> +- Quentin Theuret \<\> +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - Jairo Llopis + - Ernesto Tejeda + - Carlos Roca +- Sudhir Arya \<\> +- Pierre Pizzetta \<\> +- Mantas Šniukas \<\> diff --git a/web_dialog_size/readme/DESCRIPTION.md b/web_dialog_size/readme/DESCRIPTION.md new file mode 100644 index 000000000000..cd588ffddcd5 --- /dev/null +++ b/web_dialog_size/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +A module that lets the user expand/restore the dialog box size through a +button in the upper right corner (imitating most windows managers). It +also adds draggable support to the dialogs. diff --git a/web_dialog_size/readme/ROADMAP.md b/web_dialog_size/readme/ROADMAP.md new file mode 100644 index 000000000000..df8c2291b925 --- /dev/null +++ b/web_dialog_size/readme/ROADMAP.md @@ -0,0 +1 @@ +- Allow setting default dialog size per user. diff --git a/web_dialog_size/static/description/icon.png b/web_dialog_size/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/web_dialog_size/static/description/icon.png differ diff --git a/web_dialog_size/static/description/index.html b/web_dialog_size/static/description/index.html new file mode 100644 index 000000000000..e0d9251f239d --- /dev/null +++ b/web_dialog_size/static/description/index.html @@ -0,0 +1,468 @@ + + + + + +Web Dialog Size + + + +
+

Web Dialog Size

+ + +

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 +button in the upper right corner (imitating most windows managers). It +also adds draggable support to the dialogs.

+

Table of contents

+ +
+

Configuration

+

By default, the module respects the caller’s dialog_size option. If +you want to set dialog boxes maximized by default, you need to:

+
    +
  1. Go to Settings -> Technical -> Parameters -> System Parameters

    +
  2. +
  3. +
    Add a new record with the text web_dialog_size.default_maximize +in
    +
    the Key field and the text True in the Value field
    +
    +
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • Allow setting default dialog size per user.
  • +
+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
  • Therp BV
  • +
  • Siddharth Bhalgami
  • +
  • Tecnativa
  • +
  • Amaris
  • +
+
+
+

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_dialog_size/static/src/js/web_dialog_size.esm.js b/web_dialog_size/static/src/js/web_dialog_size.esm.js new file mode 100644 index 000000000000..068bc3abd619 --- /dev/null +++ b/web_dialog_size/static/src/js/web_dialog_size.esm.js @@ -0,0 +1,81 @@ +import {Component, onMounted} from "@odoo/owl"; +import {ActionDialog} from "@web/webclient/actions/action_dialog"; +import {Dialog} from "@web/core/dialog/dialog"; +import {SelectCreateDialog} from "@web/views/view_dialogs/select_create_dialog"; +import {patch} from "@web/core/utils/patch"; +import {useService} from "@web/core/utils/hooks"; + +export class ExpandButton extends Component { + setup() { + this.orm = useService("orm"); + this.last_size = this.props.getsize(); + this.config = this.orm.call( + "ir.config_parameter", + "get_web_dialog_size_config" + ); + + onMounted(() => { + var self = this; + this.config.then(function (r) { + if (r.default_maximize) { + self.dialog_button_extend(); + } + }); + }); + } + + dialog_button_extend() { + this.props.setsize("dialog_full_screen"); + this.render(); + } + + dialog_button_restore() { + this.props.setsize(this.last_size); + this.render(); + } +} + +ExpandButton.template = "web_dialog_size.ExpandButton"; + +patch(Dialog.prototype, { + setup() { + super.setup(); + this.setSize = this.setSize.bind(this); + this.getSize = this.getSize.bind(this); + }, + + setSize(size) { + this.props.size = size; + this.render(); + }, + + getSize() { + return this.props.size; + }, +}); + +patch(SelectCreateDialog.prototype, { + setup() { + super.setup(); + this.setSize = this.setSize.bind(this); + this.getSize = this.getSize.bind(this); + }, + + setSize(size) { + this.props.size = size; + this.render(); + }, + + getSize() { + return this.props.size; + }, +}); + +Object.assign(ActionDialog.components, {ExpandButton}); +SelectCreateDialog.components = Object.assign(SelectCreateDialog.components || {}, { + ExpandButton, +}); +Dialog.components = Object.assign(Dialog.components || {}, {ExpandButton}); +// Patch annoying validation method +Dialog.props.size.validate = (s) => + ["sm", "md", "lg", "xl", "dialog_full_screen"].includes(s); diff --git a/web_dialog_size/static/src/scss/web_dialog_size.scss b/web_dialog_size/static/src/scss/web_dialog_size.scss new file mode 100644 index 000000000000..44e2066f1aa2 --- /dev/null +++ b/web_dialog_size/static/src/scss/web_dialog_size.scss @@ -0,0 +1,16 @@ +.modal { + .modal-dialog_full_screen { + @include media-breakpoint-up(sm) { + max-width: 100%; + width: calc(100% - 50px); + } + } + + .dialog_button_restore, + .dialog_button_extend { + margin-left: auto; + + .btn-close { + margin: -8px -8px -8px 0px; + } + } +} diff --git a/web_dialog_size/static/src/xml/ExpandButton.xml b/web_dialog_size/static/src/xml/ExpandButton.xml new file mode 100644 index 000000000000..87ea9472d202 --- /dev/null +++ b/web_dialog_size/static/src/xml/ExpandButton.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/web_dialog_size/static/src/xml/select_create_dialog.xml b/web_dialog_size/static/src/xml/select_create_dialog.xml new file mode 100644 index 000000000000..1ba58a6bfcc9 --- /dev/null +++ b/web_dialog_size/static/src/xml/select_create_dialog.xml @@ -0,0 +1,8 @@ + + + + + props.size + + + diff --git a/web_dialog_size/static/src/xml/web_dialog_header.xml b/web_dialog_size/static/src/xml/web_dialog_header.xml new file mode 100644 index 000000000000..2cdfecd9fc0d --- /dev/null +++ b/web_dialog_size/static/src/xml/web_dialog_header.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/web_dialog_size/tests/__init__.py b/web_dialog_size/tests/__init__.py new file mode 100644 index 000000000000..79d02635e051 --- /dev/null +++ b/web_dialog_size/tests/__init__.py @@ -0,0 +1 @@ +from . import test_web_dialog_size diff --git a/web_dialog_size/tests/test_web_dialog_size.py b/web_dialog_size/tests/test_web_dialog_size.py new file mode 100644 index 000000000000..0eefbd984545 --- /dev/null +++ b/web_dialog_size/tests/test_web_dialog_size.py @@ -0,0 +1,20 @@ +# Copyright 2018 Tecnativa - Ernesto Tejeda +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 + +from odoo.tests.common import TransactionCase + + +class TestWebDialogSize(TransactionCase): + def setUp(self): + super().setUp() + + def test_get_web_dialog_size_config(self): + obj = self.env["ir.config_parameter"] + + self.assertFalse(obj.get_web_dialog_size_config()["default_maximize"]) + + obj.set_param("web_dialog_size.default_maximize", "True") + self.assertTrue(obj.get_web_dialog_size_config()["default_maximize"]) + + obj.set_param("web_dialog_size.default_maximize", "False") + self.assertFalse(obj.get_web_dialog_size_config()["default_maximize"])