Browse Source

[FIX] migrate the error handler too

pull/890/head
Holger Brunn 7 years ago
parent
commit
610f187987
No known key found for this signature in database GPG Key ID: 1C9760FECA3AE18
  1. 3
      support_branding/static/src/js/support_branding.js
  2. 4
      support_branding/static/src/xml/base.xml

3
support_branding/static/src/js/support_branding.js

@ -2,12 +2,14 @@
/* Copyright 2012-2015 Therp
* Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com>
* Copyright 2017 - redO2oo - Robert Rottermann <robert@redO2oo.ch>
* Copyright 2018 - Therp BV
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define('web.support_branding', function(require) {
var CrashManager = require('web.CrashManager');
var core = require('web.core');
var Model = require('web.Model');
var session = require('web.session');
var _t = core._t;
CrashManager.include({
init: function() {
@ -27,6 +29,7 @@ odoo.define('web.support_branding', function(require) {
},
show_error: function(error) {
var self = this;
error._session = session;
this._super.apply(this, arguments);
jQuery('.support-branding-submit-form').each(function() {
var $form = jQuery(this),

4
support_branding/static/src/xml/base.xml

@ -4,12 +4,12 @@
<t t-jquery="div" t-operation="after">
<div>
<form class="support-branding-submit-form oe_form" action="mailto:" enctype="text/plain" method="get">
<input type="hidden" name="subject" t-attf-value="#{session.username}@#{session.db} [#{session.server}]: #{error.message}" />
<input type="hidden" name="subject" t-attf-value="#{error._session.username}@#{error._session.db} [#{error._session.server}]: #{error.message}" />
<input type="hidden" name="body" t-attf-value="#{error.data.debug}" />
<div class="oe_form_field_text oe_form_required">
<textarea name="description" placeholder="Please fill in how you produced this error..." class="" />
</div>
<button class="oe_highlight">Email to support company</button>
<button class="btn btn-sm btn-primary">Email to support company</button>
</form>
</div>
</t>

Loading…
Cancel
Save