Browse Source

QMS Release

pull/64/head
Mathias Markl 6 years ago
parent
commit
1460316c52
  1. 3
      muk_web_client_refresh/__manifest__.py
  2. 6
      muk_web_client_refresh/models/res_config_settings.py
  3. 17
      muk_web_client_refresh/static/src/js/client_refresh.js
  4. 6
      muk_web_security/doc/index.rst
  5. 7
      muk_web_security/static/description/index.html

3
muk_web_client_refresh/__manifest__.py

@ -20,7 +20,7 @@
{
"name": "MuK Web Refresh",
"summary": """Web Client Refresh""",
"version": "11.0.2.1.0",
"version": "11.0.2.1.2",
"category": "Extra Tools",
"license": "AGPL-3",
"website": "http://www.mukit.at",
@ -31,6 +31,7 @@
],
"depends": [
"base_automation",
"muk_automation_extension",
"muk_web_client",
],
"data": [

6
muk_web_client_refresh/models/res_config_settings.py

@ -25,9 +25,11 @@ class ResConfigSettings(models.TransientModel):
refresh_delay = fields.Integer(
string="Delay",
help="""Delays the execution of refresh and thus prevents the view from being reloaded too often.
For example, a delay of 1000 (ms) would mean that the view cannot be reloaded more than once a second. """)
help="""Prevents multiple executions of refresh in a certain timeframe to avoid the view from being
reloaded too often. For example, a delay of 1000 (ms) would mean that the view cannot be
reloaded more than once a second.""")
@api.multi
def set_values(self):
res = super(ResConfigSettings, self).set_values()
param = self.env['ir.config_parameter'].sudo()

17
muk_web_client_refresh/static/src/js/client_refresh.js

@ -25,15 +25,13 @@ var session = require('web.session');
var config = require('web.config');
var bus = require('bus.bus');
var utils = require('muk_web_utils.common');
WebClient.include({
start: function () {
var self = this;
var load_config = this._rpc({
route: '/config/muk_web_client_refresh.refresh_delay',
}).done(function(result) {
self.refresh_delay = result.refresh_delay;
self.refresh = _.throttle(self.refresh.bind(self), result.refresh_delay || 1000, true);
});
return $.when(this._super.apply(this, arguments), load_config);
},
@ -45,26 +43,21 @@ WebClient.include({
refresh: function(message) {
var widget = this.action_manager && this.action_manager.inner_widget;
var active_view = widget ? widget.active_view : false;
if (active_view && message.uid && session.uid !== message.uid) {
if (active_view && session.uid !== message.uid) {
var controller = this.action_manager.inner_widget.active_view.controller;
if(controller.modelName === message.model && controller.mode === "readonly") {
if(active_view.type === "form" && message.ids.includes(widget.env.currentId)) {
this.reload(controller);
controller.reload();
} else if(active_view.type === "list" &&
(message.create || _.intersection(message.ids, widget.env.ids) >= 1)) {
this.reload(controller);
controller.reload();
} else if(active_view.type === "kanban" &&
(message.create || _.intersection(message.ids, widget.env.ids) >= 1)) {
this.reload(controller);
controller.reload();
}
}
}
},
reload: function(controller) {
utils.delay(function() {
controller.reload();
}, this.refresh_delay || 1000);
},
});
});

6
muk_web_security/doc/index.rst

@ -2,8 +2,8 @@
MuK Web Security
================
Technical module to provide some utility features and libraries that can be used
in other applications. This module has no direct effect on the running system.
Technical module to extend the security module. This module has no direct
effect on the running system.
Installation
============
@ -23,7 +23,7 @@ No additional configuration is needed to use this module.
Usage
=============
This module has no direct visible effect on the system. It provide utility features.
This module has no direct visible effect on the system. It provide security features.
Credits
=======

7
muk_web_security/static/description/index.html

@ -11,10 +11,9 @@
<div class="oe_row oe_spaced">
<div style="max-width: 84%; margin: 16px 8%;">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">Technical module to provide some utility
features. The module is mainly used as a dependency by other modules
and to provide a collection of common libraries. It has no direct
visible effect on the system.</p>
<p class="oe_mt32">Technical module to extend the security
module. The module is mainly used as a dependency by other modules
and has no direct visible effect on the system.</p>
</div>
</div>
</section>

Loading…
Cancel
Save