Skip to content

Commit

Permalink
[NEW] easy_debug
Browse files Browse the repository at this point in the history
* easy_debug_backend
* easy_debug_frontend

Those two modules constantly provide 'debug mode'
  • Loading branch information
Jonathan Nemry committed Oct 24, 2014
1 parent 86b134c commit 5945efb
Show file tree
Hide file tree
Showing 10 changed files with 218 additions and 0 deletions.
28 changes: 28 additions & 0 deletions easy_debug_backend/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs.
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contact a Free Software
# Service Company.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
49 changes: 49 additions & 0 deletions easy_debug_backend/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs.
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contact a Free Software
# Service Company.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Easy Debug Backend',
'version': '1.0',
'author': 'ACSONE SA/NV',
'maintainer': 'ACSONE SA/NV',
'website': 'http://www.acsone.eu',
'category': 'Other',
'depends': [
'base',
],
'description': """
Easy Debug Backend
==================
Constantly apply 'debug mode' for backend
""",
'data': [
'views/easy_debug_backend.xml',
],
'installable': True,
'auto_install': False,
}
Binary file added easy_debug_backend/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions easy_debug_backend/static/src/js/easy_debug_backend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
openerp.easy_debug_backend = function(instance) {

instance.web.ActionManager.include({
init : function() {
this._super.apply(this, arguments);
},
do_action : function(action, options) {
if (window.location.href.indexOf('debug') == -1) {
window.location = $.param.querystring(window.location.href,
'debug');
}
return this._super.apply(this, arguments);
}
});

};
16 changes: 16 additions & 0 deletions easy_debug_backend/views/easy_debug_backend.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version='1.0' encoding='UTF-8' ?>
<openerp>
<data noupdate="0">

<!-- BACKEND -->
<template id="assets_backend"
name="website.assets_backend (easy_debug_backend)"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript"
src="/easy_debug_backend/static/src/js/easy_debug_backend.js"></script>
</xpath>
</template>

</data>
</openerp>
28 changes: 28 additions & 0 deletions easy_debug_frontend/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs.
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contact a Free Software
# Service Company.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
50 changes: 50 additions & 0 deletions easy_debug_frontend/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs.
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contact a Free Software
# Service Company.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Easy Debug Frontend',
'version': '1.0',
'author': 'ACSONE SA/NV',
'maintainer': 'ACSONE SA/NV',
'website': 'http://www.acsone.eu',
'category': 'Other',
'depends': [
'easy_debug_backend',
'website',
],
'description': """
Easy Debug Frontend
===================
Constantly apply 'debug mode' for frontend
""",
'data': [
'views/easy_debug_frontend.xml',
],
'installable': True,
'auto_install': False,
}
Binary file added easy_debug_frontend/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions easy_debug_frontend/static/src/js/easy_debug_frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(function() {
'use strict';

var website = openerp.website;
var _t = openerp._t;
var _super_website_ready = website.ready;

website.ready = function(options) {
if (window.location.href.indexOf('debug') == -1) {
window.location = $.param
.querystring(window.location.href, 'debug');
}
return _super_website_ready();
}
})();
16 changes: 16 additions & 0 deletions easy_debug_frontend/views/easy_debug_frontend.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version='1.0' encoding='UTF-8' ?>
<openerp>
<data noupdate="0">

<!-- FRONTEND -->
<template id="assets_frontend"
name="website.assets_frontend (easy_debug_frontend)"
inherit_id="website.assets_frontend">
<xpath expr="." position="inside">
<script type="text/javascript"
src="/easy_debug_frontend/static/src/js/easy_debug_frontend.js"></script>
</xpath>
</template>

</data>
</openerp>

0 comments on commit 5945efb

Please sign in to comment.