Generating warnings during report run

20 views
Skip to first unread message

Jon Levy

unread,
Jan 17, 2018, 11:59:00 AM1/17/18
to tryton
I am wondering what the correct idiom is to issue warnings while running a report. Reports do not inherit from WarningErrorMixin, and run in readonly transaction. I have a report that requires quite a bit of computation, and I would like to be able to possibly issue a warning.

If I try to call the warning based on a Model (that I am otherwise using in the report), it raises an error that it can't be done in a readonly transaction.

Is it appropriate to raise the warning with a Transaction().new_cursor context manager?

Cédric Krier

unread,
Jan 17, 2018, 12:40:06 PM1/17/18
to tryton
I think it goes against the general idea of having Report being
readonly.
Indeed I think you should run a wizard that will raise the warning or
launch the report.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Jon Levy

unread,
Jan 17, 2018, 1:17:59 PM1/17/18
to tryton
On Wednesday, January 17, 2018 at 12:40:06 PM UTC-5, Cédric Krier wrote:

That's what I suspected. Thanks for verifying.

Reply all
Reply to author
Forward
0 new messages