Logging on console/log file

68 views
Skip to first unread message

Khurram Shahzad

unread,
Oct 5, 2016, 7:10:16 AM10/5/16
to try...@googlegroups.com
Dear All,

I am updating some modules as per requirement of our company.

How can I log from within modules to console/log file?

Is there any way that I can show information in dialogue boxes. This information is basically some text messages along with values of some variables.

--
 
Regards,
Khurram.

Sergi Almacellas Abellana

unread,
Oct 5, 2016, 7:13:30 AM10/5/16
to try...@googlegroups.com
El 05/10/16 a les 13:00, Khurram Shahzad ha escrit:
> Dear All,
>
> I am updating some modules as per requirement of our company.
>
> How can I log from within modules to console/log file?

Yes, you can use the python logging module:

https://docs.python.org/2.7/library/logging.html
>
> Is there any way that I can show information in dialogue boxes. This
> information is basically some text messages along with values of some
> variables.

And when do you want to show this information?

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Cédric Krier

unread,
Oct 5, 2016, 8:10:11 AM10/5/16
to try...@googlegroups.com
On 2016-10-05 13:13, Sergi Almacellas Abellana wrote:
> > Is there any way that I can show information in dialogue boxes. This
> > information is basically some text messages along with values of some
> > variables.
>
> And when do you want to show this information?

I guess he means a way to notify the user.
I think we already discussed about that (can not find it) and the idea
was that the client could do a long polling connection and the server
side we use listen/notify (only postgresql) and a API to send
notification. The advantage is that it could be used also to notify with
on_change.
Someone should write a blueprint for that.

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

Khurram Shahzad

unread,
Oct 5, 2016, 9:25:04 AM10/5/16
to try...@googlegroups.com
Dear Sergi,
On Wed, Oct 5, 2016 at 4:13 PM, Sergi Almacellas Abellana <se...@koolpi.com> wrote:
El 05/10/16 a les 13:00, Khurram Shahzad ha escrit:
Dear All,

I am updating some modules as per requirement of our company.

How can I log from within modules to console/log file?

Yes, you can use the python logging module:

https://docs.python.org/2.7/library/logging.html

Is there any way that I can show information in dialogue boxes. This
information is basically some text messages along with values of some
variables.

And when do you want to show this information?
I have made some changes in a button's action handler. And just want to show an information dialogue box at the end of an action. 
--
 
Regards,
Khurram.

Sergi Almacellas Abellana

unread,
Oct 5, 2016, 9:59:27 AM10/5/16
to try...@googlegroups.com
El 05/10/16 a les 14:39, Khurram Shahzad ha escrit:
> I have made some changes in a button's action handler. And just want to
> show an information dialogue box at the end of an action.
Then you should create a wizard that presents the information to the
user and decorate your button function with button_acction[1] with the
xml id of the new wizard action to execute it when the button have been
finished.

[1]
http://doc.tryton.org/4.0/trytond/doc/ref/models/models.html?highlight=button_action#trytond.model.ModelView.button_action

Cédric Krier

unread,
Oct 5, 2016, 10:00:03 AM10/5/16
to try...@googlegroups.com
On 2016-10-05 17:39, Khurram Shahzad wrote:
> >> Is there any way that I can show information in dialogue boxes. This
> >> information is basically some text messages along with values of some
> >> variables.
> >>
> >
> > And when do you want to show this information?
>
> I have made some changes in a button's action handler. And just want to
> show an information dialogue box at the end of an action.

You must use a wizard for that.

Khurram Shahzad

unread,
Oct 5, 2016, 10:43:49 AM10/5/16
to try...@googlegroups.com

On Wed, Oct 5, 2016 at 6:59 PM, Sergi Almacellas Abellana <se...@koolpi.com> wrote:
El 05/10/16 a les 14:39, Khurram Shahzad ha escrit:
I have made some changes in a button's action handler. And just want to
show an information dialogue box at the end of an action.
Then you should create a wizard that presents the information to the user and decorate your button function with button_acction[1] with the xml id of the new wizard action to execute it when the button have been finished.

[1] http://doc.tryton.org/4.0/trytond/doc/ref/models/models.html?highlight=button_action#trytond.model.ModelView.button_action

Thanks.

Khurram Shahzad

unread,
Oct 5, 2016, 10:43:49 AM10/5/16
to try...@googlegroups.com
On Wed, Oct 5, 2016 at 6:55 PM, Cédric Krier <cedric...@b2ck.com> wrote:
On 2016-10-05 17:39, Khurram Shahzad wrote:
> >> Is there any way that I can show information in dialogue boxes. This
> >> information is basically some text messages along with values of some
> >> variables.
> >>
> >
> > And when do you want to show this information?
>
> I have made some changes in a button's action handler. And just want to
> show an information dialogue box at the end of an action.

You must use a wizard for that.
Thanks.

Guillem Barba Domingo

unread,
Nov 8, 2016, 6:20:47 AM11/8/16
to try...@googlegroups.com

El 5 oct. 2016 2:10 p. m., "Cédric Krier" <cedric...@b2ck.com> escribió:
>
> On 2016-10-05 13:13, Sergi Almacellas Abellana wrote:
> > > Is there any way that I can show information in dialogue boxes. This
> > > information is basically some text messages along with values of some
> > > variables.
> >
> > And when do you want to show this information?
>
> I guess he means a way to notify the user.
> I think we already discussed about that (can not find it) and the idea
> was that the client could do a long polling connection and the server
> side we use listen/notify (only postgresql) and a API to send
> notification. The advantage is that it could be used also to notify with
> on_change.
> Someone should write a blueprint for that.

In the "System Messages" topic in Discuss (https://discuss.tryton.org/t/system-messages/109/4) we talked the possibility to use XMPP protocol for this "push notifications".

Guillem

Reply all
Reply to author
Forward
0 new messages