为什么我得到一个白屏,当我激活与我的自定义模块安装的开发人员模式

Why am I getting an white screen when I activate the developer mode with my custom module installed?

本文关键字:模块 自定义 安装 我的 开发 模式 激活 白屏 一个 为什么      更新时间:2023-09-26

我正在为OpenERP v7开发一个简单的图片库,因为我需要在服务器中编写带有托管图像的邮件模板。

我正在编程这个功能修改模块web_ckeditor4。

我的主要问题是当我启用开发人员模式屏幕变白,我得到一个JavaScript错误(qweb2.js文件抛出):

Uncaught Error: QWeb2: This page contains the following errors:error on line 1 at column 52: Space required after the Public Identifier
Below is a rendering of the page up to the first error.

抛出异常的qweb2.js文件片段

var QWeb2 = {
    expressions_cache: {},
    RESERVED_WORDS: 'true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,typeof,eval,void,Math,RegExp,Array,Object,Date'.split(','),
    ACTIONS_PRECEDENCE: 'foreach,if,call,set,esc,escf,raw,rawf,js,debug,log'.split(','),
    WORD_REPLACEMENT: {
        'and': '&&',
        'or': '||',
        'gt': '>',
        'gte': '>=',
        'lt': '<',
        'lte': '<='
    },
    tools: {
        exception: function(message, context) {
            context = context || {};
            var prefix = 'QWeb2';
            if (context.template) {
                prefix += " - template['" + context.template + "']";
            }
            throw new Error(prefix + ": " + message);
        },

我检查了我的JavaScript文件和我使用的视图模板文件,语法似乎是OK的。

如果有人知道发生了什么,我将感谢任何帮助。

如果这对其他人有帮助,我收到这个错误,因为我在qweb xml文件中有一个空格作为第一个字符。

嗯,我将模块迁移到Odoo v8,现在似乎一切都很好。我不知道为什么这在OpenERP v7中不起作用,但我不再关心