Odoo 中文社区

    • 注册
    • 登录
    • 搜索
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    widget.getTitle is not a function

    Odoo 新手求助
    1
    1
    198
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • F
      fritz1126 最后由 编辑

      本人刚接触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
      • First post
        Last post