Discussion:
[tryton] Generating warnings during report run
Jon Levy
2018-01-17 16:59:00 UTC
Permalink
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?
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/4729ffc5-0c6a-4b1b-97a9-11b27d15c48d%40googlegroups.com.
Cédric Krier
2018-01-17 17:38:25 UTC
Permalink
Post by Jon Levy
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?
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: ***@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/20180117173825.GF4241%40kei.
Jon Levy
2018-01-17 18:17:59 UTC
Permalink
On Wednesday, January 17, 2018 at 12:40:06 PM UTC-5, Cédric Krier wrote:

That's what I suspected. Thanks for verifying.
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/c43fb4c6-3e02-4566-b973-d1e8bee54839%40googlegroups.com.
Continue reading on narkive:
Loading...