Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
67 changes: 0 additions & 67 deletions web_dialog_size/README.rst
Original file line number Diff line number Diff line change
@@ -1,67 +0,0 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

=============
Expand Dialog
=============

A module that lets the user expand/restore the dialog box size through a button
in the upper right corner (mimicking most windows managers).
It does also add draggable support to the dialogs.

Configuration
=============

By default, the module respects the caller's `dialog_size` option. If you want
to override this and have all dialogs maximized by default, set the configuration
parameter `web_dialog_size.default_maximize` to `1`.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/11.0

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 smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Anthony Muschang <[email protected]>
* Stéphane Bidoul <[email protected]>
* Pedro M. Baeza <[email protected]>
* Holger Brunn <[email protected]>
* Siddharth Bhalgami <[email protected]>
* Wolfgang Pichler <[email protected]>
* David Vidal <[email protected]>
* Quentin Theuret <[email protected]>

Do not contact contributors directly about support or help with technical issues.

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove totally this file, as runbot will fail. You have 2 options:

  • Put a line like the template one: **This file is going to be generated by oca-gen-addon-readme.**
  • Run oca-gen-addon-readme locally for generating the README and not letting the bot do it at night.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? doesn't it create it later automatically?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but meanwhile you will have a red build

3 changes: 1 addition & 2 deletions web_dialog_size/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Copyright 2018 Quentin Theuret <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
4 changes: 2 additions & 2 deletions web_dialog_size/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"Tecnativa, "
"Amaris, "
"Odoo Community Association (OCA)",
'website': "http://acsone.eu",
'website': "http://github.com/OCA/web",
'category': 'web',
'version': '11.0.1.0.2',
'version': '11.0.1.0.3',
'license': 'AGPL-3',
'depends': [
'web',
Expand Down
1 change: 1 addition & 0 deletions web_dialog_size/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import ir_config_parameter
17 changes: 17 additions & 0 deletions web_dialog_size/models/ir_config_parameter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2018 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.models import api, Model
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 {
key: const_eval(get_param("web_dialog_size.%s" % key, "False"))
for key in ["default_maximize"]
}
3 changes: 3 additions & 0 deletions web_dialog_size/readme/CONFIGURATION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
By default, the module respects the caller's ``dialog_size`` option.
If you want to override this and have all dialogs maximized by default,
set the configuration parameter ``web_dialog_size.default_maximize`` to ``1``.
14 changes: 14 additions & 0 deletions web_dialog_size/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Contributors
------------

* Anthony Muschang <[email protected]>
* Stéphane Bidoul <[email protected]>
* Holger Brunn <[email protected]>
* Siddharth Bhalgami <[email protected]>
* Wolfgang Pichler <[email protected]>
* David Vidal <[email protected]>
* Quentin Theuret <[email protected]>
* `Tecnativa <https://www.tecnativa.com>`_:

* Pedro M. Baeza <[email protected]>
* Jairo Llopis <[email protected]>
3 changes: 3 additions & 0 deletions web_dialog_size/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 8 additions & 7 deletions web_dialog_size/static/src/js/web_dialog_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) {
var rpc = require('web.rpc');
var Dialog = require('web.Dialog');

var config = rpc.query({
model: 'ir.config_parameter',
method: 'get_web_dialog_size_config',
});

Dialog.include({

willStart: function () {
var self = this;
return this._super.apply(this, arguments).then(function () {
self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending'));
self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore'));
return rpc.query({
model: 'ir.config_parameter',
method: 'get_param',
args: ['web_dialog_size.default_maximize',],
}).then(function(default_maximize) {
if (default_maximize === "True" || default_maximize === 1) {
return config.done(function(default_maximize) {
if (default_maximize) {
self._extending();
} else {
self._restore();
Expand All @@ -32,7 +33,7 @@ Dialog.include({
handle: '.modal-header',
helper: false
});
};
}
return this;
},

Expand Down