跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 新手求助
  4. widget.getTitle is not a function

widget.getTitle is not a function

已定时 已固定 已锁定 已移动 Odoo 新手求助
1 帖子 1 发布者 329 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • F 离线
    F 离线
    fritz1126
    写于 最后由 编辑
    #1

    本人刚接触ODOO,参考网上分享的案例尝试widget开发,注册了一个客户端动作,代码如下:

    odoo.define('load_echarts', function (require) {
        "use strict";
        var core = require('web.core');
        var Widget = require('web.Widget');
    
        // 定义打开模板
        var Echarts = Widget.extend({
            // 模板名称 对应上面xml中t-name
            template: 'echarts_capa_homepage',
    
            init: function(parent, data){
                return this._super.apply(this, arguments);
            },
    
            start: function(){
                return true;
            },
    
        });
    
        // 将上面定义的打开模板注册成客户端动作名对应client_action中的tag
        core.action_registry.add('load_echarts.load_capa_homepage', Echarts);
    
    })
    

    但运行的时候报错了,错误信息如下:

    TypeError: widget.getTitle is not a function
        at Class._executeClientAction (http://localhost:8069/web/static/src/js/chrome/action_manager.js:446:27)
        at Class._handleAction [as _super] (http://localhost:8069/web/static/src/js/chrome/action_manager.js:669:29)
        at Class._handleAction (http://localhost:8069/web/static/src/js/chrome/action_manager_act_window.js:404:28)
        at Class.<anonymous> (http://localhost:8069/web/static/src/js/core/class.js:123:38)
        at Class._handleAction (http://localhost:8069/web/static/src/js/chrome/action_manager_report.js:164:28)
        at Class._handleAction (http://localhost:8069/web/static/src/js/core/class.js:123:38)
        at http://localhost:8069/web/static/src/js/chrome/action_manager.js:165:25
    

    琢磨了很久也都没头绪,向大神们求助……:disappointed_but_relieved_face: :disappointed_but_relieved_face: :disappointed_but_relieved_face:

    1 条回复 最后回复
    0

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    • 第一个帖子
      最后一个帖子
    0
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组