【发布时间】:2018-08-20 03:46:41
【问题描述】:
我在 Windows localhost 中使用 Odoo v11,我还是初学者。
最近,我尝试编辑 posticket,突然,销售点模块停止加载它保持空白页面。
我已经清除了浏览器的缓存并重新启动了odoo服务,它工作了。
但是,收据没有显示,错误信息显示如下:
Uncaught TypeError: Cannot read property 'vat_label' of null
http://localhost:8069/point_of_sale/static/src/js/models.js:2121
Traceback:
TypeError: Cannot read property 'vat_label' of null
at child.export_for_printing
(http://localhost:8069/point_of_sale/static/src/js/models.js:2121:44)
at Class.get_receipt_render_env
(http://localhost:8069/point_of_sale/static/src/js/screens.js:1538:28)
at Class.render_receipt
(http://localhost:8069/point_of_sale/static/src/js/screens.js:1616:77)
at Class.show
(http://localhost:8069/point_of_sale/static/src/js/screens.js:1505:14)
at Class.prototype.(anonymous function) [as show]
(http://localhost:8069/web/static/src/js/core/class.js:90:38)
at Class.show_screen
(http://localhost:8069/point_of_sale/static/src/js/gui.js:116:33)
at Class.finalize_validation
(http://localhost:8069/point_of_sale/static/src/js/screens.js:2071:22)
at Class.validate_order [as _super]
(http://localhost:8069/point_of_sale/static/src/js/screens.js:2080:18)
at Class.validate_order
(http://localhost:8069/pos_mercury/static/src/js/pos_mercury.js:687:14)
at Class.validate_order
(http://localhost:8069/web/static/src/js/core/class.js:123:38)
编辑:
我已经删除了我插入到 posticket 的所有 HTML 代码,现在它仅在我使用资产激活开发人员模式时才有效。当停用并尝试生成 pos sale 收据时,它会出现此错误:
Uncaught TypeError: Cannot read property 'vat_label' of null
http://localhost:4883/web/content/2266-abace1e/point_of_sale.assets.js:197
Traceback:
TypeError: Cannot read property 'vat_label' of null
at child.export_for_printing (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:197:863)
at Class.get_receipt_render_env (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:379:1110)
at Class.render_receipt (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:379:2226)
at Class.show (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:379:409)
at Class.prototype.(anonymous function) [as show]
(http://localhost:4883/web/content/2189-
2963aaa/web.assets_common.js:3816:488)
at Class.show_screen (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:314:48)
at Class.finalize_validation (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:400:1111)
at Class.validate_order [as _super] (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:400:1226)
at Class.validate_order (http://localhost:4883/web/content/2266-
abace1e/point_of_sale.assets.js:448:6)
at Class.validate_order (http://localhost:4883/web/content/2189-
2963aaa/web.assets_common.js:3819:371)
非常感谢您的帮助和支持。
问候,
【问题讨论】:
-
检查 vat_label 对象。它正在尝试读取该对象的属性或属性,但该对象包含空值。在使用之前检查代码是否已为该对象分配了值。
-
@PyMaster 感谢您的回复。如果按照错误指向其写作的位置:
vat_label: company.country.vat_label,,我不知道返回 null 值是什么。 -
vat_label 不可用。请找到正确的字段而不是 vat_label
-
res.company中没有这个字段
-
vat_label 不是正确的字段。请立即删除它..