Mathias Markl 7 years ago
parent
commit
304e0720f7
  1. 2
      muk_web_client_refresh/__manifest__.py
  2. 6
      muk_web_client_refresh/models/refresh_rule.py
  3. 3
      muk_web_client_refresh/static/src/js/client_refresh.js
  4. 2
      muk_web_share/__manifest__.py
  5. 17
      muk_web_share/static/src/js/share_dialog.js

2
muk_web_client_refresh/__manifest__.py

@ -29,7 +29,7 @@
"refresh" rules. These rules can be applied to any Odoo model and "refresh" rules. These rules can be applied to any Odoo model and
trigger a refresh either on create, write or unlink. trigger a refresh either on create, write or unlink.
""", """,
"version": "11.0.1.0.1",
"version": "11.0.1.0.3",
"category": "Extra Tools", "category": "Extra Tools",
"license": "AGPL-3", "license": "AGPL-3",
"website": "http://www.mukit.at", "website": "http://www.mukit.at",

6
muk_web_client_refresh/models/refresh_rule.py

@ -108,7 +108,7 @@ class RefreshRule(models.Model):
@api.returns('self', lambda value: value.id) @api.returns('self', lambda value: value.id)
def create_refresh(self, vals, **kwargs): def create_refresh(self, vals, **kwargs):
result = create_refresh.origin(self, vals, **kwargs) result = create_refresh.origin(self, vals, **kwargs)
self.env['bus.bus'].sendone('refresh', self._name)
self.env['bus.bus'].sendone('refresh', [self.env.cr.dbname, self._name, self._uid])
return result return result
@ -119,7 +119,7 @@ class RefreshRule(models.Model):
@api.multi @api.multi
def write_refresh(self, vals, **kwargs): def write_refresh(self, vals, **kwargs):
result = write_refresh.origin(self, vals, **kwargs) result = write_refresh.origin(self, vals, **kwargs)
self.env['bus.bus'].sendone('refresh', self._name)
self.env['bus.bus'].sendone('refresh', [self.env.cr.dbname, self._name, self._uid])
return result return result
return write_refresh return write_refresh
@ -128,6 +128,6 @@ class RefreshRule(models.Model):
@api.multi @api.multi
def unlink_refresh(self, **kwargs): def unlink_refresh(self, **kwargs):
result = unlink_refresh.origin(self, **kwargs) result = unlink_refresh.origin(self, **kwargs)
self.env['bus.bus'].sendone('refresh', self._name)
self.env['bus.bus'].sendone('refresh', [self.env.cr.dbname, self._name, self._uid])
return result return result
return unlink_refresh return unlink_refresh

3
muk_web_client_refresh/static/src/js/client_refresh.js

@ -33,7 +33,8 @@ WebClient.include({
refresh: function(message) { refresh: function(message) {
var widget = this.action_manager.inner_widget; var widget = this.action_manager.inner_widget;
var active_view = widget ? widget.active_view : false; var active_view = widget ? widget.active_view : false;
if (active_view){
if (active_view && message instanceof Array && message.length === 3) {
var message = message[1];
var controller = this.action_manager.inner_widget.active_view.controller var controller = this.action_manager.inner_widget.active_view.controller
if (controller.modelName === message && if (controller.modelName === message &&
!controller.$el.hasClass('o_form_editable')){ !controller.$el.hasClass('o_form_editable')){

2
muk_web_share/__manifest__.py

@ -28,7 +28,7 @@
can be shared with another user. On mobile devices, can be shared with another user. On mobile devices,
the link of the form can be posted to Whatsapp. the link of the form can be posted to Whatsapp.
""", """,
"version": "11.0.1.0.0",
"version": "11.0.1.0.2",
"category": "Extra Tools", "category": "Extra Tools",
"license": "AGPL-3", "license": "AGPL-3",
"website": "http://www.mukit.at", "website": "http://www.mukit.at",

17
muk_web_share/static/src/js/share_dialog.js

@ -40,6 +40,7 @@ var ShareDialog = Dialog.extend({
dialogClass: 'muk_share_dialog_body', dialogClass: 'muk_share_dialog_body',
$content: $(QWeb.render('muk_web_share.ShareDialog', { $content: $(QWeb.render('muk_web_share.ShareDialog', {
widget: this, widget: this,
isMobile: config.device.isMobile,
})), })),
buttons: [{ buttons: [{
text: _t("Close"), text: _t("Close"),
@ -175,11 +176,19 @@ var ShareDialog = Dialog.extend({
this.do_notify(_t("Link has been copied to clipboard!")); this.do_notify(_t("Link has been copied to clipboard!"));
}, },
formatUrl: function(url) { formatUrl: function(url) {
if(this.__parentedParent && this.__parentedParent.state) {
var data = this.__parentedParent.state.data;
return $('<div>').append($('<a>',{
text: data.name || url,
title: _t('Odoo Link'),
href: url,
})).html();
}
return $('<div>').append($('<a>',{ return $('<div>').append($('<a>',{
text: url,
title: _t('Odoo Link'),
href: url,
})).html();
text: url,
title: _t('Odoo Link'),
href: url,
})).html();
} }
}); });

Loading…
Cancel
Save