Browse Source

[FIX] account_financial_report: get module compatible with HomeMenu widget added by web_enterprise module

Steps to reproduce:

* install account_financial_report module alongside Odoo Enterpise
* open General Ledger report
* click on View button
* click on Home button or by using the shortcut (Shift +h)

Current behaviour:

Uncaught TypeError: currentController.widget.on_detach_callback is not a function

http://localhost:8069/web/static/src/js/chrome/action_manager.js:94
Traceback:
TypeError: currentController.widget.on_detach_callback is not a function
    at Class.on_detach_callback (http://localhost:8069/web/static/src/js/chrome/action_manager.js:94:38)
    at http://localhost:8069/web/static/src/js/core/dom.js:175:26
    at Function._.each._.forEach (http://localhost:8069/web/static/lib/underscore/underscore.js:145:9)
    at Object.detach (http://localhost:8069/web/static/src/js/core/dom.js:173:11)
    at http://localhost:8069/web_enterprise/static/src/js/web_client.js:289:21
    at http://localhost:8069/web/static/lib/jquery/jquery.js:3276:89
    at fire (http://localhost:8069/web/static/lib/jquery/jquery.js:3119:58)
    at Object.add [as done] (http://localhost:8069/web/static/lib/jquery/jquery.js:3165:49)
    at Array.<anonymous> (http://localhost:8069/web/static/lib/jquery/jquery.js:3275:77)
    at Function.each (http://localhost:8069/web/static/lib/jquery/jquery.js:383:58)

In addition, after having implemented on_detach_callback, if I click on the icon chevron left or by using the shortcut, I get the following error:

Uncaught TypeError: currentController.widget.on_attach_callback is not a function
http://localhost:8069/web/static/src/js/chrome/action_manager.js:84
Traceback:
TypeError: currentController.widget.on_attach_callback is not a function
    at Class.on_attach_callback (http://localhost:8069/web/static/src/js/chrome/action_manager.js:84:38)
    at http://localhost:8069/web/static/src/js/core/dom.js:38:22
    at Function._.each._.forEach (http://localhost:8069/web/static/lib/underscore/underscore.js:145:9)
    at _notify (http://localhost:8069/web/static/src/js/core/dom.js:36:7)
    at Object.append (http://localhost:8069/web/static/src/js/core/dom.js:60:13)
    at Class.toggle_home_menu (http://localhost:8069/web_enterprise/static/src/js/web_client.js:305:17)
    at Class.self.toggle_home_menu (http://localhost:8069/web_enterprise/static/src/js/widgets/debug_manager.js:21:38)
    at Class._onHideHomeMenu (http://localhost:8069/web_enterprise/static/src/js/web_client.js:329:18)
    at Class.<anonymous> (http://localhost:8069/web/static/src/js/core/mixins.js:278:23)
    at Class.trigger (http://localhost:8069/web/static/src/js/core/mixins.js:225:31)
pull/742/head
tafaRU 4 years ago
parent
commit
a349c47d57
  1. 6
      account_financial_report/static/src/js/account_financial_report_backend.js

6
account_financial_report/static/src/js/account_financial_report_backend.js

@ -104,6 +104,12 @@ odoo.define('account_financial_report.account_financial_report_backend', functio
canBeRemoved: function () {
return $.when();
},
on_attach_callback: function () {
this.isInDOM = true;
},
on_detach_callback: function () {
this.isInDOM = false;
},
});
core.action_registry.add(

Loading…
Cancel
Save