Browse Source

[MIG] Migrate web_dialog_size module to v11

pull/1110/head
Quentin Theuret 7 years ago
committed by Pedro M. Baeza
parent
commit
01b0514940
  1. 3
      web_dialog_size/README.rst
  2. 2
      web_dialog_size/__init__.py
  3. 5
      web_dialog_size/__manifest__.py
  4. 46
      web_dialog_size/static/src/js/web_dialog_size.js

3
web_dialog_size/README.rst

@ -19,7 +19,7 @@ parameter `web_dialog_size.default_maximize` to `1`.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/10.0
:target: https://runbot.odoo-community.org/runbot/162/11.0
Bug Tracker Bug Tracker
=========== ===========
@ -47,6 +47,7 @@ Contributors
* Siddharth Bhalgami <siddharth.bhalgami@gmail.com> * Siddharth Bhalgami <siddharth.bhalgami@gmail.com>
* Wolfgang Pichler <wpichler@callino.at> * Wolfgang Pichler <wpichler@callino.at>
* David Vidal <david.vidal@tecnativa.com> * David Vidal <david.vidal@tecnativa.com>
* Quentin Theuret <quentin.theuret@amaris.com>
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.

2
web_dialog_size/__init__.py

@ -0,0 +1,2 @@
# Copyright 2018 Quentin Theuret <quentin.theuret@amaris.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

5
web_dialog_size/__manifest__.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2015 ACSONE SA/NV # Copyright 2015 ACSONE SA/NV
# Copyright 2018 Amaris
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
@ -11,10 +11,11 @@
"Therp BV, " "Therp BV, "
"Siddharth Bhalgami," "Siddharth Bhalgami,"
"Tecnativa, " "Tecnativa, "
"Amaris, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
'website': "http://acsone.eu", 'website': "http://acsone.eu",
'category': 'web', 'category': 'web',
'version': '10.0.1.0.2',
'version': '11.0.1.0.1',
'license': 'AGPL-3', 'license': 'AGPL-3',
'depends': [ 'depends': [
'web', 'web',

46
web_dialog_size/static/src/js/web_dialog_size.js

@ -1,34 +1,39 @@
odoo.define('web_dialog_size.web_dialog_size', function (require) { odoo.define('web_dialog_size.web_dialog_size', function (require) {
'use strict'; 'use strict';
var Model = require('web.DataModel');
var rpc = require('web.rpc');
var Dialog = require('web.Dialog'); var Dialog = require('web.Dialog');
Dialog.include({ Dialog.include({
init: function (parent, options) {
willStart: function () {
var self = this; var self = this;
this._super.apply(this, arguments);
self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending'));
self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore'));
new Model('ir.config_parameter').query(['key', 'value']).
filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) {
if (default_maximize.length && default_maximize[0].value == 1) {
self._extending();
} else {
self._restore();
}
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) {
self._extending();
} else {
self._restore();
}
});
}); });
}, },
open: function() { open: function() {
var res = this._super.apply(this, arguments);
this.$modal.draggable({
handle: '.modal-header',
helper: false
});
return res;
this._super.apply(this, arguments);
if (this.$modal) {
this.$modal.draggable({
handle: '.modal-header',
helper: false
});
};
return this;
}, },
close: function() { close: function() {
@ -36,8 +41,7 @@ Dialog.include({
if (draggable) { if (draggable) {
this.$modal.draggable("destroy"); this.$modal.draggable("destroy");
} }
var res = this._super.apply(this, arguments);
return res;
return this._super.apply(this, arguments);
}, },
_extending: function() { _extending: function() {

Loading…
Cancel
Save