Browse Source

[MIG] web_dialog_size: Migration to 12.0

pull/1110/head
ernesto 6 years ago
committed by Pedro M. Baeza
parent
commit
3413b34041
  1. 24
      web_dialog_size/README.rst
  2. 2
      web_dialog_size/__manifest__.py
  3. 4
      web_dialog_size/models/ir_config_parameter.py
  4. 5
      web_dialog_size/readme/CONFIGURE.rst
  5. 5
      web_dialog_size/readme/CONTRIBUTORS.rst
  6. 44
      web_dialog_size/static/description/index.html
  7. 15
      web_dialog_size/static/src/css/web_dialog_size.css
  8. 24
      web_dialog_size/static/src/scss/web_dialog_size.scss
  9. 2
      web_dialog_size/static/src/xml/web_dialog_size.xml
  10. 2
      web_dialog_size/templates/assets.xml
  11. 1
      web_dialog_size/tests/__init__.py
  12. 20
      web_dialog_size/tests/test_web_dialog_size.py

24
web_dialog_size/README.rst

@ -14,13 +14,13 @@ Web Dialog Size
: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/11.0/web_dialog_size
:target: https://github.com/OCA/web/tree/12.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-11-0/web-11-0-web_dialog_size
:target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_dialog_size
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/11.0
:target: https://runbot.odoo-community.org/runbot/162/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@ -34,13 +34,22 @@ It also adds draggable support to the dialogs.
.. contents::
:local:
Configuration
=============
If you want to set dialog boxes maximized by default, you need to:
#. Go to *Settings -> Technical -> Parameters -> System Parameters*
#. Add a new record with the text *web_dialog_size.default_maximize* in
the *Key* field and the text *True* in the *Value* field
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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_dialog_size%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_dialog_size%0Aversion:%2012.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.
@ -68,8 +77,9 @@ Contributors
* Quentin Theuret <quentin.theuret@amaris.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Pedro M. Baeza
* Jairo Llopis
* Ernesto Tejeda
Maintainers
~~~~~~~~~~~
@ -84,6 +94,6 @@ 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/11.0/web_dialog_size>`_ project on GitHub.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_dialog_size>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

2
web_dialog_size/__manifest__.py

@ -15,7 +15,7 @@
"Odoo Community Association (OCA)",
'website': "http://github.com/OCA/web",
'category': 'web',
'version': '11.0.1.0.3',
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'depends': [
'web',

4
web_dialog_size/models/ir_config_parameter.py

@ -12,6 +12,6 @@ class IrConfigParameter(Model):
def get_web_dialog_size_config(self):
get_param = self.sudo().get_param
return {
key: const_eval(get_param("web_dialog_size.%s" % key, "False"))
for key in ["default_maximize"]
"default_maximize": const_eval(
get_param("web_dialog_size.default_maximize", "False"))
}

5
web_dialog_size/readme/CONFIGURE.rst

@ -0,0 +1,5 @@
If you want to set dialog boxes maximized by default, you need to:
#. Go to *Settings -> Technical -> Parameters -> System Parameters*
#. Add a new record with the text *web_dialog_size.default_maximize* in
the *Key* field and the text *True* in the *Value* field

5
web_dialog_size/readme/CONTRIBUTORS.rst

@ -7,5 +7,6 @@
* Quentin Theuret <quentin.theuret@amaris.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Pedro M. Baeza
* Jairo Llopis
* Ernesto Tejeda

44
web_dialog_size/static/description/index.html

@ -367,34 +367,47 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_dialog_size"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_dialog_size"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_dialog_size"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_dialog_size"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>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.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<p>If you want to set dialog boxes maximized by default, you need to:</p>
<ol class="arabic simple">
<li>Go to <em>Settings -&gt; Technical -&gt; Parameters -&gt; System Parameters</em></li>
<li><dl class="first docutils">
<dt>Add a new record with the text <em>web_dialog_size.default_maximize</em> in</dt>
<dd>the <em>Key</em> field and the text <em>True</em> in the <em>Value</em> field</dd>
</dl>
</li>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_dialog_size%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_dialog_size%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>ACSONE SA/NV</li>
<li>Therp BV</li>
@ -404,7 +417,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>Anthony Muschang &lt;<a class="reference external" href="mailto:anthony.muschang&#64;acsone.eu">anthony.muschang&#64;acsone.eu</a>&gt;</li>
<li>Stéphane Bidoul &lt;<a class="reference external" href="mailto:stephane.bidoul&#64;acsone.eu">stephane.bidoul&#64;acsone.eu</a>&gt;</li>
@ -414,20 +427,21 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li>
<li>Quentin Theuret &lt;<a class="reference external" href="mailto:quentin.theuret&#64;amaris.com">quentin.theuret&#64;amaris.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Pedro M. Baeza &lt;<a class="reference external" href="mailto:pedro.baeza&#64;tecnativa.com">pedro.baeza&#64;tecnativa.com</a>&gt;</li>
<li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt;</li>
<li>Pedro M. Baeza</li>
<li>Jairo Llopis</li>
<li>Ernesto Tejeda</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/11.0/web_dialog_size">OCA/web</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_dialog_size">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

15
web_dialog_size/static/src/css/web_dialog_size.css

@ -1,15 +0,0 @@
.modal .modal-header button.dialog_button_extend {
padding-right: 5px;
}
.modal .modal-header button.dialog_button_restore {
padding-right: 5px;
}
.dialog_full_screen {
width: calc(100% - 50px);
}
.modal .modal-header button.close {
font-size: 18px;
}

24
web_dialog_size/static/src/scss/web_dialog_size.scss

@ -0,0 +1,24 @@
.modal {
.dialog_full_screen {
@include media-breakpoint-up(sm) {
max-width: 100%;
width: calc(100% - 50px);
}
}
.modal-header button.close {
font-size: 18px;
&:not(.dialog_button_extend):not(.dialog_button_restore) {
@include media-breakpoint-up(sm) {
margin-left: 15px;
}
}
&.dialog_button_extend, .dialog_button_restore {
@include media-breakpoint-down(sm) {
display: none !important;
}
}
}
}

2
web_dialog_size/static/src/xml/web_dialog_size.xml

@ -4,7 +4,7 @@
<t t-jquery="button.close" t-operation="inner">
<i class="fa fa-close" />
</t>
<t t-jquery="button.close" t-operation="after">
<t t-jquery="button.close" t-operation="before">
<button type="button" class="dialog_button_extend close"><i class="fa fa-expand" /></button>
<button type="button" class="dialog_button_restore close"><i class="fa fa-compress" /></button>
</t>

2
web_dialog_size/templates/assets.xml

@ -2,7 +2,7 @@
<odoo>
<template id="assets_backend" name="web_dialog_size assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/web_dialog_size/static/src/css/web_dialog_size.css"/>
<link rel="stylesheet" href="/web_dialog_size/static/src/scss/web_dialog_size.scss"/>
<script type="text/javascript" src="/web_dialog_size/static/src/js/web_dialog_size.js"></script>
</xpath>
</template>

1
web_dialog_size/tests/__init__.py

@ -0,0 +1 @@
from . import test_web_dialog_size

20
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(TestWebDialogSize, self).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'])
Loading…
Cancel
Save