IRC logs of #tryton for Monday, 2012-07-02 #tryton log beginning Mon Jul 2 00:00:01 CEST 2012
Ariadnehi! i have a issue with tryton and need some help, plz! :)09:34
nicoeAriadne: Don't ask to ask ... just ask ;)09:36
__efx__Hi there, I would like to understand why the installation of modules takes usually a while. What is the main limiting step ?16:30
bechamel`__efx__: the slowest module to install is country, because it contains a lot of data16:36
__efx__bechamel: ok I understand now, is this also the reason why an "empty" database (I mean with only modules installed but no other information) is already 20 Mb16:39
__efx__bechamel : sorry, that is not true16:44
bechamel`__efx__: I think an empty db is around 2Mb16:47
__efx__bechamel: It makes more sence16:50
__efx__I have a question concerning proteus. I select all the currencies using the find method with no parameter then I loop on the result and show the name of the currency. My problem is that the process is slow as if proteus was doing one select per entry how can I avoid that ?17:29
__efx__..or maybe I did something in the wrong way18:11
__efx__no proteus expert around there ?18:12
bechamel`__efx__: it depends on your definition of expert :)18:13
nicoe__efx__: can you post your code somewhere ?18:15
__efx__bechamel : :) ok let say I use this definition of expert : somebody who has tried to do something like : for currency in currencies : print using a xmlrpc connection to a tryton server18:15
__efx__Actually I have nowhere to post.. maybe here.. my code is a 4 line code18:17
__efx__1: from proteus import config, Model, Wizard18:17
__efx__2: config.set_xmlrpc('http://'+user+':'+password+'@'+server+':'+port+'/'+database)18:17
__efx__3 : Currency = Model.get('currency.currency')18:18
__efx__4: currencies = Currency.find()18:18
__efx__5: for currency in currencies :18:18
__efx__6:     print currency.name18:18
__efx__that's it18:18
bechamel`__efx__: what's the problem ?18:19
__efx__bechamel: it takes more than 1 minutes to print all the name18:20
__efx__bechamel: I don't expect xmlrpc to be fast but 1 minutes is a lot18:20
nicoeI have never tried proteus over xmlrpc but I think that sharoon did18:22
nicoe(he made a patch to use json-rpc)18:22
bechamel`__efx__: I think it is slow because proteus call the server for each iteration of the loop18:26
__efx__nicoe : is it faster with json-rpc18:27
__efx__I will try it when back home18:27
__efx__I can find the patch on pipy ?18:27
nicoeno the patch is on codereview :
__efx__thank you guys18:29
bechamel`__efx__: I think you will not get more than a 10% improvement18:30
__efx__have to leave,18:31
bechamel`__efx__: if it is your main use case it's diffcult to have better perfs18:31
bechamel`__efx__: but proteus should be a better fit if you do not iterate on long lists18:32
bechamel`__efx__: a bit like a real user would do with the gtk client18:32
rhubnerhi nicoe19:15
nicoerhubner: hello19:23
rhubnernicoe: to make something functional in tryton client I was thinking of adding the widget the way I did in prototype... After I leave most unusual and beautiful19:26
rhubnernicoe: what do you think?19:26
nicoeThat's a good start indeed19:28
rhubnernicoe: Mas eu precisava saber onde adicionar o widget e como chamá-lo.19:29
rhubnernicoe: ow sorry19:29
rhubnernicoe: I need to know where I call this widget19:30
rhubnernicoe: I was thinking of putting this directory19:33
rhubnernicoe: would it be correct?19:33
nicoeI think the container is defined in tryton/gui/window/view_form/view/form.py19:34
rhubnernicoe: is better developed in another file and call this file in
nicoeI think indeed that you should develop it in another file19:38
nicoeBut you will need also to be plugged in with the screen in order to be able to reload the form with the correct context19:39
rhubnernicoe: Therein lies the problem! I do not know how to connect this widget with How this should be done? Do I need to do anything else in other files?19:42
nicoerhubner: of course19:43
nicoeYou need to add the widget to the form view. And bind the callback called when you're moving the cursor to a reload of the current form with the datetime information taken from the widget19:44
nicoerhubner: the screen object tryton/gui/window/view_form/screen/ is probably the place where the reload should happend19:46
rhubnernicoe: Sorry to say, but I'm not understand anything of what I do. I'm lost in all these files...19:52
rhubnernicoe: I understood correctly how to make the widget but I do not know how/where must be happen this calls and callbacks in these files.19:56
rhubnernicoe: a very simple example (like hello world) would help me reproduce the widget I am developing. Is it possible you show something like this?20:01
rhubnernicoe: inadvertently abuse your patience...20:02
nicoeI'll try to make something tonight20:02
nicoerhubner: I'll keep you posted20:02
rhubnernicoe: Ok.. thank you! I'll be connected if you have any news! I will improve the widget meanwhile..20:05
nicoerhubner: OK. Did you understand what we meant by "zooming" in the time20:06
rhubnernicoe: i think so... There can be many changes at different times right?20:08
nicoerhubner: yes20:09
nicoerhubner: And I guess there will be a lot of changes in a short amount of time then a long period without changes20:10
nicoerhubner: and then again a lot of small changes in a short amount of time20:10
rhubnernicoe: zoom would help focus on different sets of modifications far. I just do not know if I keep trying to change only in pygtk or longer would be better to add something in javascript.20:10
nicoedon't try to include javascript20:11
nicoeI think you should have a way to display this information20:11
rhubnernicoe: only pygtk now?20:11
nicoeMaybe a canvas above the timeline widget with histogram displaying number of changes per month/week20:12
nicoerhubner: yes pygtk and a canvas library20:12
nicoegoocanvas would be a sensible choice since smoldersan (our other GSOC student) is also using it20:12
nicoeget in touch with him20:13
rhubnernicoe: good! I think it's best to learn, because I do not like web languages ​​like javascript20:13
rhubnernicoe: humm.. I'll take a look at goocanvas so... thanks20:15
rhubnernicoe: what time is it there? (I dont know what timezone you are)20:17
nicoeUTC+2 it's 20:1920:20
rhubnernicoe: here it's 15:20 (UTC - 3)20:21
__efx__bechamel: using jsonrpc instead of xmlrpc I have a decrease of around 60% in the duration with the simple script I made20:31
udononicoe: rhubner: I tried out the timeline prototype review two weeks ago and I like it!20:33
udononicoe: rhubner: Having a design question: Will the widget be shown per default on every view which model has history activated? (I don't know if the client already knows about _history property of a model...) or will it be controlled explicit like the other widgets in a view?20:39
nicoeI should be displayed automatically for every model I think20:40
nicoeDo you have another idea ?20:40
udononicoe: No, I thing so, too.20:40
udononicoe: I collected some ideas about the zoom, but really hard to explain gui objects in text metaphors maybe I try to draw some pictures...20:43
nicoeudono: ok good20:45
lukiohello, i have a problem to set a default field One2Many using a Wizard. my pastebin is at
lukioi want to set up a one2many field before the view appears20:50
lukioany idea?20:54
__efx__In proteus, is there a way to close the connection after having call config.set_trytond or config.set_xmlprc ?21:46
__efx__from ipython if I use a %reset to reset all the variables I still can connect to my trytond server through proteus with no need to call config.set_... that s really strange22:02
__efx__no ?22:02
bechamel`__efx__: I think you can disconnect with the logout method on user22:38
__efx__bechamel: when do you say the logout method on user you mean on res.user model ?22:42
bechamel`__efx__: yes22:44
__efx__the User from User = Model.get('res.user') has only a login method22:45
__efx__either an instance of User, like that user = User()22:46
bechamel`__efx__: sorry, auth is made by the xmlrpclib, so disconnect should also be done through it22:47
bechamel`__efx__: and it looks like xmlrpc is stateless22:48
bechamel`__efx__: so it create a connection for each call22:48
bechamel`__efx__: this also explain why your loop on currencies is so slow :)22:48
bechamel`__efx__: if you really want to disconnect you may try config._config.current = None22:51
__efx__bechamel : do you mean config._CONFIG.current = None ?22:52
bechamel`__efx__: yes, it seems better :)22:54
__efx__bechamel: but in that case I can not do config.set_trytond...  neither config.set_jsonrpc I have an AttributeError exception22:54
__efx__Ok I just have to start a new local thread22:55
__efx__so it is :22:55
__efx__config._CONFIG = None22:55
__efx__config._CONFIG = threading.local()22:55
__efx__bechamel: thank you very much :)22:56
bechamel`__efx__: are you using multithreading code ?22:59
__efx__bechamel: no I am using proteus with django and I wanted to save the thread (only one) in memcache so that the same is used at each page access23:01
__efx__bechamel: I don't know if I am clear..23:01
bechamel`__efx__: I don't understand what you put in memcache actually23:04
__efx__bechamel : actually I don't know what to cache that is my current problem23:07
__efx__bechamel: I thought to cach something like config._CONFIG but that does not work23:07
bechamel`__efx__: as xmlrpc is stateless, you cannot cache a lot of stuff23:09
bechamel`__efx__: user name and password :)23:09
__efx__and could I cache something if I use config.set_trytond?23:11
__efx__bechamel: instead of xmlrpc ?23:11
bechamel`__efx__: so I update what I said earlier (if I undestand correctly how xmlrpc work): with jsonrpc you may hope to divide by two the time to loop on currencies :)23:11
__efx__bechamel: yes actually that's the result I obtained approximately twice faster23:12
bechamel`__efx__: what about caching the data themself ?23:12
__efx__bechamel: your are completely right I even don't know why I was thinking of caching the thread instead of caching the data directly23:19
__efx__bechamel: again thank yo23:19
bechamel`__efx__: I know a webshop made with tryton that cache all the products and hit directly tryton only to place orders. It's really quick23:19
nicoerhubner: ping23:20
rhubnernicoe: hi23:21
__efx__bechamel: okay I will use that strategy then !23:21
bechamel`__efx__: when everything is in cache tryton is webscale :)23:21
nicoerhubner: I have a small patch that might help you a bit23:22
rhubnernicoe: great!23:22
nicoeIt's quite simple: it adds a button under the form and makes the screen available to it23:24
nicoerhubner: on this patch you have to build your timeline stuff and display it only when necessary23:25
nicoerhubner: I hope it will help you23:25
rhubnernicoe: ok... only modifies this file or have others?23:25
nicoerhubner: I don't understand23:25
rhubnernicoe: this patch you showed me only makes changes to the file or other too?23:26
nicoerhubner: it also adds a file23:29
nicoerhubner: if you apply it on trunk afterwards you can do an "hg st" to see which files has been modified23:30
rhubnernicoe: ok, thanks for help! I still go out and start working on it tonight!23:32
rhubnernicoe: thank you .. see you tomorrow!23:32
nicoerhubner: I'll go to bed now ;) see you tomorrow.23:47

Generated by 2.11.0 by Marius Gedminas - find it at!