pre-commit, black, isort

pull/2172/head
OCA-git-bot 2019-10-12 12:32:55 +02:00 committed by Mantux11
parent 8b4a18857e
commit 9b77d7fa22
3 changed files with 23 additions and 28 deletions

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

@ -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

@ -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"])