Skip to content

Commit

Permalink
Merge pull request #743 from KolushovAlexandr/12.0-web_debranding-acc…
Browse files Browse the repository at this point in the history
…ess_issues

🚑 error on res.config form opening
  • Loading branch information
Ivan Yelizariev committed May 8, 2019
2 parents a7ea34f + 9622f74 commit 58f3b3d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
2 changes: 1 addition & 1 deletion web_debranding/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions web_debranding/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`1.0.27`
--------

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

`1.0.26`
--------

Expand Down
40 changes: 12 additions & 28 deletions web_debranding/static/src/js/field_upgrade.js
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 58f3b3d

Please sign in to comment.