0

我正在尝试在 Odoo 13 社区中安装一些模块。缺少依赖'web.ControlPanelMixin'项,我正在尝试解决问题,到目前为止我没有成功。JavaScript 代码:

odoo.define('crm_dashboard.dashboard', [
  'web.core',
  'web.framework',
  'web.session',
  'web.ajax',
  'web.ActionManager',
  'web.view_registry',
  'web.Widget',
  'web.AbstractAction',
  'web.ControlPanelMixin'
], function (require) {
  "use strict";
  var core = require('web.core');
  var framework = require('web.framework');
  var session = require('web.session');
  var ajax = require('web.ajax');
  var ActionManager = require('web.ActionManager');
  var view_registry = require('web.view_registry');
  var Widget = require('web.Widget');
  var AbstractAction = require('web.AbstractAction');
  var ControlPanelMixin = require('web.ControlPanelMixin');
  var QWeb = core.qweb;
  ...
});

我尝试搜索'web.ControlPanelMixin'声明的位置:

[odoo-13.0]$ grep -rnw ./ -e 'ControlPanelMixin'
./doc/reference/javascript_reference.rst:2221:        var ControlPanelMixin = require('web.ControlPanelMixin');
./doc/reference/javascript_reference.rst:2224:        var ClientAction = AbstractAction.extend(ControlPanelMixin, {
./doc/reference/javascript_reference.rst:2262:- add ControlPanelMixin in the widget:
./doc/reference/javascript_reference.rst:2266:        var ControlPanelMixin = require('web.ControlPanelMixin');
./doc/reference/javascript_reference.rst:2268:        var MyClientAction = AbstractAction.extend(ControlPanelMixin, {
./doc/reference/javascript_reference.rst:2277:        var SomeClientAction = Widget.extend(ControlPanelMixin, {
./mymodules/odoo_crm_dashboard/static/src/js/crm_dashboard.js:11:    'odoo.web.ControlPanelMixin'
./mymodules/odoo_crm_dashboard/static/src/js/crm_dashboard.js:25:var ControlPanelMixin = require('web.ControlPanelMixin');
./mymodules/odoo_crm_dashboard/static/src/js/crm_dashboard.js:31:var CRMDashboardView = AbstractAction.extend(ControlPanelMixin, {

谢谢!

4

2 回答 2

1

我认为有一个错误:

odoo.define('crm_dashboard.dashboard', [
    'web.core',
    'web.framework',
    'web.session',
    'web.ajax',
    'web.ActionManager',
    'web.view_registry',
    'web.Widget',
    'web.AbstractAction',
    'web.ControlPanelMixin'
]

它不是web.ControlPanelMixinodoo.web.ControlPanelMixin

您可以查看此文档

于 2020-03-17T08:47:27.823 回答
0

ControlPanelMixin 在 Odoo 13.0 中被移除。

对象现在可以使用hasControlPanel: true. 有关示例,请参阅Odoo 源代码

于 2020-11-26T19:55:15.387 回答