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

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

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

Loading…
Cancel
Save