Skip to content
Permalink
Browse files

🚑 error on res.config form opening

  • Loading branch information...
KolushovAlexandr committed May 8, 2019
1 parent a7ea34f commit fbc8e2127a71a9e327126e2f85ba3f3db35de4b1
Showing with 18 additions and 29 deletions.
  1. +1 −1 web_debranding/__manifest__.py
  2. +5 −0 web_debranding/doc/changelog.rst
  3. +12 −28 web_debranding/static/src/js/field_upgrade.js
@@ -6,7 +6,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
'name': "Backend debranding",
'version': '12.0.1.0.26',
'version': '12.0.1.0.27',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
'category': 'Debranding',
@@ -1,3 +1,8 @@
`1.0.27`
--------

**Fix:** error on res.config form opening

`1.0.26`
--------

@@ -1,34 +1,17 @@
/* Copyright 2016-2017 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
Copyright 2017 ArtyomLosev <https://github.com/ArtyomLosev>
Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
odoo.define('web_debranding.field_upgrade', function (require) {
"use strict";

var field_registry = require('web.field_registry');
/*
Following line doesn't work in enterprise, because web_enterprise module
removes web/.../upgrade_fieds.js files from backend assets and adds with new
module web_enterprise.upgrade_widgets
var FormRenderer = require('web.FormRenderer');

For this reason you can see following output in browser console in Enterprise:
FormRenderer.include({
_renderTagForm: function (node) {
var $result = this._super(node);

warning: Some modules could not be started
Missing dependencies: ["web.upgrade_widgets"]
Non loaded modules: ["web_debranding.field_upgrade"]
*/
require('web.upgrade_widgets');
var UpgradeBoolean = field_registry.get('upgrade_boolean');
var UpgradeRadio = field_registry.get('upgrade_radio');

if (!UpgradeBoolean){
// we are on enterprise. No need to update
return;
}

var include = {
_render: function () {
/*
Remove following element:
@@ -48,11 +31,12 @@ odoo.define('web_debranding.field_upgrade', function (require) {
</div>
*/
// this.$el is .o_field_boolean in example above
this.$el.parent().parent().remove();
}
};
if (this.state && this.state.model === "res.config.settings"){
// hide enterprise labels with related fields
$result.find('.o_enterprise_label').parent().parent().parent().hide()
}
return $result;
},
});

UpgradeRadio.include(include);
UpgradeBoolean.include(include);
});

0 comments on commit fbc8e21

Please sign in to comment.
You can’t perform that action at this time.