mirror of https://github.com/OCA/web.git
[MIG] Migrate web_dialog_size module to v11
parent
25f3fc51cd
commit
dea2528f86
|
@ -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.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Copyright 2018 Quentin Theuret <quentin.theuret@amaris.com>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
@ -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',
|
||||||
|
|
|
@ -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);
|
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 rpc.query({
|
||||||
new Model('ir.config_parameter').query(['key', 'value']).
|
model: 'ir.config_parameter',
|
||||||
filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) {
|
method: 'get_param',
|
||||||
if (default_maximize.length && default_maximize[0].value == 1) {
|
args: ['web_dialog_size.default_maximize',],
|
||||||
|
}).then(function(default_maximize) {
|
||||||
|
if (default_maximize === "True" || default_maximize === 1) {
|
||||||
self._extending();
|
self._extending();
|
||||||
} else {
|
} else {
|
||||||
self._restore();
|
self._restore();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
open: function() {
|
open: function() {
|
||||||
var res = this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
if (this.$modal) {
|
||||||
this.$modal.draggable({
|
this.$modal.draggable({
|
||||||
handle: '.modal-header',
|
handle: '.modal-header',
|
||||||
helper: false
|
helper: false
|
||||||
});
|
});
|
||||||
return res;
|
};
|
||||||
|
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 this._super.apply(this, arguments);
|
||||||
return res;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_extending: function() {
|
_extending: function() {
|
||||||
|
|
Loading…
Reference in New Issue