IRC logs of #tryton for Tuesday, 2013-11-19 #tryton log beginning Tue Nov 19 00:00:02 CET 2013
2013-11-19 11:06 <pokoli> Hi, it's possible to call a button from proteus?
2013-11-19 11:12 <jeancavallo> pokoli: Yes and no. You do not call the button, you call the method
2013-11-19 11:12 <jeancavallo> pokoli: If your button is linked to an action, you have to emulate the action in your proteus script. For instance, if your action is a wizard, you have to manually execute it
2013-11-19 11:14 <pokoli> jeancavallo: thanks! It's a wizard, so I will call the wizard from proteus (never done it but I will try)
2013-11-19 11:17 <jeancavallo> pokoli:
2013-11-19 11:17 <pokoli> jeancavallo: do you have some example using active_id in the context'
2013-11-19 11:17 <pokoli> ??
2013-11-19 11:18 <jeancavallo> pokoli: It's one of our wizards, but you'll get the idea. The "form" attribute of the wizard is the view of the current step
2013-11-19 11:18 <jeancavallo> pokoli: What do you mean ?
2013-11-19 11:19 <pokoli> jeancavallo: When you call a wizard on the client it sets the context variables 'active_model', 'active_id'
2013-11-19 11:19 <pokoli> jeancavallo: My wizard uses this functionality, so I need to set this on the context, otherwise it will fail
2013-11-19 11:19 <jeancavallo> pokoli: I think all method calls in proteus have an optional argument which is the context
2013-11-19 11:20 <jeancavallo> pokoli: So try my_wizard = Wizard('', {'active_id': X, 'active_model': Y})
2013-11-19 11:20 <jeancavallo> pokoli: But I am not sure
2013-11-19 11:23 <pokoli> jeancavallo: found it!!! You can pass a models list to the wizard, so it ensures to set the correct context variables
2013-11-19 11:23 <pokoli> jeancavallo:
2013-11-19 11:23 <jeancavallo> pokoli: Nice :)
2013-11-19 11:23 <jeancavallo> ACTION needs to write a proteus doc... Someday
2013-11-19 11:26 <sharoonthomas> jeancavallo: we should add that as an issue on the documentation project ?
2013-11-19 11:27 <jeancavallo> sharoonthomas: Yeah, will do
2013-11-19 11:27 <pokoli> sharoonthomas: I think it's good to add issues with the parts that needs to be improved :)
2013-11-19 11:28 <sharoonthomas> pokoli: yep, and i saw the one you created
2013-11-19 11:29 <pokoli> sharoonthomas: basically it helps other people to start writing on some missing part without the need to search on the full documentation
2013-11-19 11:29 <sharoonthomas> pokoli: true
2013-11-19 11:32 <jeancavallo> ACTION just tried typing "proteus" in the docs search box :'(
2013-11-19 11:32 <yangoon1> jeancavallo: sharoonthomas: is there a link to this documentation project?
2013-11-19 11:32 <sharoonthomas> yangoon1: from ?
2013-11-19 11:32 <jeancavallo> yangoon1:
2013-11-19 11:33 <yangoon1> jeancavallo: thx!
2013-11-19 11:33 <sharoonthomas> yangoon1:
2013-11-19 11:33 <jeancavallo> yangoon1: We started this at the TUB
2013-11-19 11:33 <yangoon1> sharoonthomas: as well :)
2013-11-19 11:33 <sharoonthomas> yangoon1: i thought you were asking if there is a link to the documentation from somewhere ;)
2013-11-19 11:33 <yangoon1> great
2013-11-19 11:43 <pokoli> jeancavallo: all the doc from proteus I kwow is on it's README
2013-11-19 11:47 <jeancavallo> pokoli: More from the examples yoou can find looking in the test files :)
2013-11-19 11:47 <pokoli> jeancavallo: indeed, that's where is was looking now xD
2013-11-19 11:47 <jeancavallo> pokoli: ag -G test.*rst "Wizard"
2013-11-19 11:48 <pokoli> jeancavallo: that's what I did: >>> split = Wizard('stock.move.split', models=[move])
2013-11-19 11:48 <jeancavallo> pokoli: :)
2013-11-19 12:27 <cedk> pokoli: I think there is a problem with dialog center when there is no tabs
2013-11-19 12:28 <pokoli> cedk: what problem? There are no tabs only when opening user preferences, aren't they?
2013-11-19 12:29 <cedk> pokoli: no you can also run a wizard from the menu
2013-11-19 12:30 <pokoli> cedk: I see... we haven't tested this case. Is the demo updated?
2013-11-19 12:31 <sharoonthomas> can anyone point me to a good example of how memoize is used in tryton ?
2013-11-19 12:33 <cedk> pokoli: yes
2013-11-19 12:33 <cedk> sharoonthomas: I think there is none
2013-11-19 12:34 <sharoonthomas> cedk: ah ok, let me see if there is a test
2013-11-19 12:35 <cedk> pokoli: I see it sometimes because I'm working on adding all the popups and some happen centered on the left menu
2013-11-19 12:36 <pokoli> ACTION testing
2013-11-19 12:37 <cedk> pokoli: I did not have it all the time
2013-11-19 12:38 <pokoli> cedk: just opened upgrade wizard without tabs and it gets horitzontally centered but in the top of the screen
2013-11-19 12:38 <pokoli> cedk: and openend another time and I got in the left part of the screen :S
2013-11-19 12:38 <pokoli> cedk: but it seems quite random to me
2013-11-19 12:41 <nicoe> sharoonthomas: you can see the Cache object as some memoization
2013-11-19 12:45 <sharoonthomas> nicoe: looking into the code
2013-11-19 13:05 <cedk> Pilou: why don't you push patch of issue3341 ?
2013-11-19 13:34 <vishesh> What is Dict field? Coulnd't understand
2013-11-19 13:37 <cedk> vishesh: it is a dictionary
2013-11-19 13:39 <vishesh> cedk: Can you point me to some example?
2013-11-19 13:41 <cedk> vishesh: the product_attribute module
2013-11-19 13:42 <vishesh> cedk: thanks :)
2013-11-19 15:15 <Pilou> cedk: i was busy, it's done
2013-11-19 15:36 <cedk> Pilou: don't forget to close the issue then
2013-11-19 15:37 <Pilou> Status must be "resolved" or "closed" ?
2013-11-19 15:42 <cedk> Pilou: solved
2013-11-19 15:42 <cedk> Pilou: close is for the reporter
2013-11-19 15:44 <Pilou> yep i did it
2013-11-19 15:51 <Pilou> oh it occurs that you dit it before me, i didn't see that
2013-11-19 15:57 <kotek> Hi. :)
2013-11-19 15:57 <kotek> Anyone here can neso? :>
2013-11-19 15:58 <kotek> I have problems with issue 3508
2013-11-19 17:00 <Pilou> cedk: subjects of mails submitted to with "hg email -s '[3341]'" are prefixed with '[PATCH]' (eg '[PATCH] [3341]'), so there are not recognized by roundup. How to avoid the '[PATCH]' prefix ?
2013-11-19 17:01 <cedk> Pilou: it worked for me
2013-11-19 17:10 <Pilou> i received this message from roundup-admin:
2013-11-19 17:12 <cedk> Pilou: of course you miss "issue"
2013-11-19 17:14 <Pilou> yep thanks !
2013-11-19 17:45 -!- hellhound(~hellhound@ has left #tryton
2013-11-19 19:48 <motaro> Good afternoon, question I want to get the first element in a Many2One field how can I do that?
2013-11-19 19:53 <motaro> Let me explain a little more is for an ODT report that I need pick the first entry on a Many2One field.
2013-11-19 20:02 <SpartanWarrior> seems strange, you need some criteria to sort the fields and pick the first
2013-11-19 20:15 <motaro> SpartanWarrior, I was thinking something like '<CLASS.MANY2ONEFIELD[0]>' inside the odt.
2013-11-19 20:19 <motaro> SpartanWarrior, Did you know that the Spartan had a system with two Kings, They were the first society to be known to have formal education for Woman since an early age. And they had an economic system in which the Land was assigned to the citizens and they couldn't sell, rented nor inherited the state will asign it if a citizen couldn't use it anymore.
2013-11-19 20:20 <SpartanWarrior> from now on I know it, thanks! :D
2013-11-19 20:21 <SpartanWarrior> im more like an amateur to tryton, but I think at the database level there is likely no way to get 'the first' record of something without any sort of ordering criteria
2013-11-19 20:32 <cedk> motaro: FYI, many2one as only one record so I gues you are talking about one2many
2013-11-19 20:32 <cedk> motaro: then just record.one2many[0] pick the first
2013-11-19 20:43 <motaro> ok thanks cedk
2013-11-19 21:33 <plantian> is it possible to somehow use this as a library to connect to tryton from regular python -- ? it seems that tryton globally depends on gtk during import time and cannot be used as a library
2013-11-19 21:34 <plantian> and by "this", i mean the ServerProxy in that file
2013-11-19 21:37 <SpartanWarrior> yes, you can
2013-11-19 21:37 <SpartanWarrior> in fact, the gtk client uses rpc to 'talk' with trytond
2013-11-19 21:38 <plantian> SpartanWarrior: but it seems that it needs a custom json rpc proxy, will any other one work? ie. ?
2013-11-19 21:44 <SpartanWarrior> Nope, you can specify the port trytond will listen to the rpc calls
2013-11-19 21:44 <SpartanWarrior> if you can use the gtk client with trytond it's already listenting
2013-11-19 21:44 <plantian> ?
2013-11-19 21:46 <SpartanWarrior> trytond haves a builtin rpc server, you don't need anything else to connect with it
2013-11-19 21:47 <plantian> SpartanWarrior: I need an rpc client library, the proxy class, to connect to the rpc server programmatically.
2013-11-19 21:48 <plantian> SpartanWarrior: The one shipped with the tryton client seems pretty custom to me and when I try to import it the tryton library requires gtk which I won't have installed on the deployment server.
2013-11-19 21:48 <SpartanWarrior> ah! you can use python's standard xmlrpclib
2013-11-19 21:50 <plantian> SpartanWarrior: but the tryton client is extending it with a lot of code as seen in the file I linked, do I just have to write all that code again... myself or is there another library that will work?
2013-11-19 21:50 <plantian> The server proxy is extended as well as the transport.
2013-11-19 21:55 <SpartanWarrior> it seems that wrappers adds failsafe functionality, I don't know if there is something like this detached from the server (and don't believe in me blindly, I know almost nothing lol), you can also strip it and use in your client apps...

Generated by 2.17.3 by Marius Gedminas - find it at!