[IMP] Improved code and solved the bug of two arrows in dialog.

pull/3042/head
sudhir-erpharbor 2019-10-11 11:40:03 +05:30 committed by jguerriat
parent 5f2571d688
commit 33649baef3
7 changed files with 36 additions and 41 deletions

View File

@ -14,13 +14,13 @@ Web Dialog Size
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/12.0/web_dialog_size :target: https://github.com/OCA/web/tree/13.0/web_dialog_size
:alt: OCA/web :alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_dialog_size :target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_dialog_size
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/12.0 :target: https://runbot.odoo-community.org/runbot/162/13.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -49,7 +49,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. 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. 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 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:%2012.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:%2013.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. Do not contact contributors directly about support or help with technical issues.
@ -96,6 +96,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_dialog_size>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/13.0/web_dialog_size>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -3,28 +3,22 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': "Web Dialog Size", "name": "Web Dialog Size",
'summary': """ "summary": """
A module that lets the user expand a A module that lets the user expand a
dialog box to the full screen width.""", dialog box to the full screen width.""",
'author': "ACSONE SA/NV, " "author": "ACSONE SA/NV, "
"Therp BV, " "Therp BV, "
"Siddharth Bhalgami," "Siddharth Bhalgami,"
"Tecnativa, " "Tecnativa, "
"Amaris, " "Amaris, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
'website': "http://github.com/OCA/web", "website": "http://github.com/OCA/web",
'category': 'web', "category": "web",
'version': '13.0.1.0.0', "version": "13.0.1.0.0",
'license': 'AGPL-3', "license": "AGPL-3",
'depends': [ "depends": ["web"],
'web', "qweb": ["static/src/xml/web_dialog_size.xml"],
], "data": ["templates/assets.xml"],
'qweb': [ "installable": True,
'static/src/xml/web_dialog_size.xml',
],
'data': [
'templates/assets.xml',
],
'installable': True,
} }

View File

@ -4,9 +4,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 12.0\n" "Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@ -17,4 +17,3 @@ msgstr ""
#: model:ir.model,name:web_dialog_size.model_ir_config_parameter #: model:ir.model,name:web_dialog_size.model_ir_config_parameter
msgid "System Parameter" msgid "System Parameter"
msgstr "" msgstr ""

View File

@ -1,7 +1,7 @@
# Copyright 2018 Tecnativa - Jairo Llopis # Copyright 2018 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.models import api, Model from odoo.models import Model, api
from odoo.tools.safe_eval import const_eval from odoo.tools.safe_eval import const_eval
@ -13,5 +13,6 @@ class IrConfigParameter(Model):
get_param = self.sudo().get_param get_param = self.sudo().get_param
return { return {
"default_maximize": const_eval( "default_maximize": const_eval(
get_param("web_dialog_size.default_maximize", "False")) get_param("web_dialog_size.default_maximize", "False")
)
} }

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! 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/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 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/13.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-13-0/web-13-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/13.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 <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). in the upper right corner (imitating most windows managers).
It also adds draggable support to the dialogs.</p> It also adds draggable support to the dialogs.</p>
@ -401,7 +401,7 @@ It also adds draggable support to the dialogs.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. <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. 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 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:%2012.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:%2013.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> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -432,6 +432,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Ernesto Tejeda</li> <li>Ernesto Tejeda</li>
</ul> </ul>
</li> </li>
<li>Sudhir Arya &lt;<a class="reference external" href="mailto:sudhir&#64;erpharbor.com">sudhir&#64;erpharbor.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
@ -441,7 +442,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</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>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/13.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> <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>
</div> </div>

View File

@ -16,7 +16,7 @@ Dialog.include({
return this._super.apply(this, arguments).then(function () { return this._super.apply(this, arguments).then(function () {
self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending'));
self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore'));
return (function(r) { return config.then(function(r) {
if (r.default_maximize) { if (r.default_maximize) {
self._extending(); self._extending();
} else { } else {

View File

@ -9,12 +9,12 @@ class TestWebDialogSize(TransactionCase):
super(TestWebDialogSize, self).setUp() super(TestWebDialogSize, self).setUp()
def test_get_web_dialog_size_config(self): def test_get_web_dialog_size_config(self):
obj = self.env['ir.config_parameter'] obj = self.env["ir.config_parameter"]
self.assertFalse(obj.get_web_dialog_size_config()['default_maximize']) self.assertFalse(obj.get_web_dialog_size_config()["default_maximize"])
obj.set_param("web_dialog_size.default_maximize", "True") obj.set_param("web_dialog_size.default_maximize", "True")
self.assertTrue(obj.get_web_dialog_size_config()['default_maximize']) self.assertTrue(obj.get_web_dialog_size_config()["default_maximize"])
obj.set_param("web_dialog_size.default_maximize", "False") obj.set_param("web_dialog_size.default_maximize", "False")
self.assertFalse(obj.get_web_dialog_size_config()['default_maximize']) self.assertFalse(obj.get_web_dialog_size_config()["default_maximize"])