简体   繁体   English

Odoo15 | 未捕获 Promise 错误 > deserializeDateTime

[英]Odoo15 | Uncaught Promise Error > deserializeDateTime

I've been developing some modules that extend Sale, Inventory, and MRP (manufacturing) and have been getting this error on occasion.我一直在开发一些扩展销售、库存和 MRP(制造)的模块,但有时会出现此错误。

I've tried clearing my browser's cache but that hasn't worked to address the bug.我已尝试清除浏览器的缓存,但未能解决该错误。

As a temporary fix I'll drop my db, create a new one with the same name and then load the modules, but that's not sustainable long term.作为临时修复,我将删除我的数据库,创建一个具有相同名称的新数据库,然后加载模块,但从长远来看这是不可持续的。

Any suggestions on why this issue pops up or how to fix it are greatly appreciated!非常感谢任何关于为什么会出现此问题或如何解决它的建议!

Uncaught Promise > deserializeDateTime is not a function
TypeError: deserializeDateTime is not a function
    at new ExpirationPanel (http://localhost:8069/web/assets/138-5429130/web.assets_backend.min.js:9992:157)
    at QWeb.eval (eval at _compile (http://localhost:8069/web/assets/97-5c5a31b/web.assets_common.min.js:1016:178), <anonymous>:34:16)
    at QWeb.fn (http://localhost:8069/web/assets/97-5c5a31b/web.assets_common.min.js:998:173)
    at QWeb.render (http://localhost:8069/web/assets/97-5c5a31b/web.assets_common.min.js:1005:20)
    at HomeMenu.__render (http://localhost:8069/web/assets/97-5c5a31b/web.assets_common.min.js:1334:33)
    at HomeMenu.__prepareAndRender (http://localhost:8069/web/assets/97-5c5a31b/web.assets_common.min.js:1332:29)```

Well I think I found a temporary solution.好吧,我想我找到了一个临时解决方案。 After looking for the deserializeDateTime function on the Odoo repository and enterprise I was able to find where it caused the error.在 Odoo 存储库和企业上查找 deserializeDateTime function 后,我能够找到导致错误的位置。

You have to delete database.expiration_date in ir.config_parameter (Menu technical > system params ) which allows to pass in the else here:您必须删除 ir.config_parameter 中的 database.expiration_date(Menu technical > system params),它允许在此处传递 else:

let expirationDate;
if (this.enterprise.expirationDate) {
    expirationDate = deserializeDateTime(this.enterprise.expirationDate);
} else {
    // If no date found, assume 1 month and hope for the best
    expirationDate = DateTime.utc().plus({ days: 30 });
}

I think I should send the error up to get more explanations...我想我应该发送错误以获得更多解释......

I've the same error with Official Odoo docker the error occurs when I install the Billing application...我与官方 Odoo docker 有同样的错误,当我安装计费应用程序时发生错误...

I am just starting to develop custom modules so for the moment there is very little code and customs.我刚刚开始开发自定义模块,所以目前只有很少的代码和习惯。 I will try without custom module to see if the error appears too.我会在没有自定义模块的情况下尝试查看错误是否也出现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM