跳至内容
菜单
此问题已终结
1 回复
433 查看

Hi Im lost on how to solve this problem, please do assist, thanks in advance. When i try to define "default_print_option, i can only name it as x_default_print_option hence unable to solve the issue.



UncaughtPromiseError > OwlError

Uncaught Promise > An error occured in the owl lifecycle (see this Error's "cause" property)

OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)

    at handleError 


*had to remove web link

Caused by: Error: "ir.actions.report"."default_print_option" field is undefined.

    at Field.parseFieldNode *had to remove web link

visitChildren *had to remove web link

    at visit *had to remove web link

    at visitChildren *had to remove web link

    at visit *had to remove web link

    at visitChildren *had to remove web link

    at visit *had to remove web link

    at visitChildren *had to remove web link

形象
丢弃

Where's the requirement for an attribute default_print_option coming from in the first place? Mostly, default_* is a constructed key enabling you to pre-set a field value to what comes after 'default_' (so, here, print_option). At a quick glance, I can't find either in core. Thus, more context and information is needed how you've reached to this problem in the first place. Did you modify a report in Studio? What version are we talking about? What report is it? What customization has been done that could be relevant here? ...

最佳答案

Hii,

You're getting this error because default_print_option is not defined on ir.actions.report.

  1. Define the field in Python:

from odoo import models, fields class ReportAction(models.Model): _inherit = 'ir.actions.report' default_print_option = fields.Selection([ ('download', 'Download'), ('open', 'Open in new tab'), ('print', 'Direct Print') ], string="Default Print Option", default='download')

upgrade your module and restart your module


i hope it is use full

形象
丢弃
相关帖文 回复 查看 活动
2
7月 25
524
0
7月 25
33
3
7月 25
89
1
7月 25
90
0
7月 25
2