【问题标题】:Odoo POS receipt errorOdoo POS 收据错误
【发布时间】: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 不是正确的字段。请立即删除它..

标签: odoo odoo-11


【解决方案1】:

事实证明,posticket 中的 <t t-esc="widget.pos.company.name"/> 正在从 modles.jsvat_label: company.country.vat_label, 返回无效值。 不幸的是,我已经删除了这两行,现在一切正常。

我会一直对此进行调查,并会及时通知您。

感谢您的支持和帮助。

问候, 大神

【讨论】:

    【解决方案2】:

    昨晚我在设置页面中删除了我公司的国家/地区数据后发生在我身上。但是当我把我的国家放回我的公司时。它再次起作用。不确定这是否有帮助。我不是技术人员。

    【讨论】:

      【解决方案3】:

      此错误与国家和Tax IVA名称字段有关,您的公司需要默认建立一些国家。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-09-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-07-11
        • 2020-08-06
        • 2021-01-04
        相关资源
        最近更新 更多