IRC logs of #tryton for Tuesday, 2013-11-19 #tryton log beginning Tue Nov 19 00:00:02 CET 2013
pokoliHi, it's possible to call a button from proteus?11:06
jeancavallopokoli: Yes and no. You do not call the button, you call the method11:12
jeancavallopokoli: 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 it11:12
pokolijeancavallo: thanks! It's a wizard, so I will call the wizard from proteus (never done it but I will try)11:14
pokolijeancavallo: do you have some example using active_id in the context'11:17
jeancavallopokoli: It's one of our wizards, but you'll get the idea. The "form" attribute of the wizard is the view of the current step11:18
jeancavallopokoli: What do you mean ?11:18
pokolijeancavallo: When you call a wizard on the client it sets the context variables 'active_model', 'active_id'11:19
pokolijeancavallo: My wizard uses this functionality, so I need to set this on the context, otherwise it will fail11:19
jeancavallopokoli: I think all method calls in proteus have an optional argument which is the context11:19
jeancavallopokoli: So try my_wizard = Wizard('', {'active_id': X, 'active_model': Y})11:20
jeancavallopokoli: But I am not sure11:20
pokolijeancavallo: found it!!! You can pass a models list to the wizard, so it ensures to set the correct context variables11:23
jeancavallopokoli: Nice :)11:23
jeancavalloACTION needs to write a proteus doc... Someday11:23
sharoonthomasjeancavallo: we should add that as an issue on the documentation project ?11:26
jeancavallosharoonthomas: Yeah, will do11:27
pokolisharoonthomas: I think it's good to add issues with the parts that needs to be improved :)11:27
sharoonthomaspokoli: yep, and i saw the one you created11:28
pokolisharoonthomas: basically it helps other people to start writing on some missing part without the need to search on the full documentation11:29
sharoonthomaspokoli: true11:29
jeancavalloACTION just tried typing "proteus" in the docs search box :'(11:32
yangoon1jeancavallo: sharoonthomas: is there a link to this documentation project?11:32
sharoonthomasyangoon1: from ?11:32
yangoon1jeancavallo: thx!11:33
sharoonthomasyangoon1: http://tryton-documentation.readthedocs.org11:33
jeancavalloyangoon1: We started this at the TUB11:33
yangoon1sharoonthomas: as well :)11:33
sharoonthomasyangoon1: i thought you were asking if there is a link to the documentation from somewhere ;)11:33
pokolijeancavallo: all the doc from proteus I kwow is on it's README11:43
jeancavallopokoli: More from the examples yoou can find looking in the test files :)11:47
pokolijeancavallo: indeed, that's where is was looking now xD11:47
jeancavallopokoli: ag -G test.*rst "Wizard"11:47
pokolijeancavallo: that's what I did:    >>> split = Wizard('stock.move.split', models=[move])11:48
jeancavallopokoli: :)11:48
cedkpokoli: I think there is a problem with dialog center when there is no tabs12:27
pokolicedk: what problem? There are no tabs only when opening user preferences, aren't they?12:28
cedkpokoli: no you can also run a wizard from the menu12:29
pokolicedk: I see... we haven't tested this case. Is the demo updated?12:30
sharoonthomascan anyone point me to a good example of how memoize is used in tryton ?12:31
cedkpokoli: yes12:33
cedksharoonthomas: I think there is none12:33
sharoonthomascedk: ah ok, let me see if there is a test12:34
cedkpokoli: I see it sometimes because I'm working on adding all the popups and some happen centered on the left menu12:35
pokoliACTION testing12:36
cedkpokoli: I did not have it all the time12:37
pokolicedk: just opened upgrade wizard without tabs and it gets horitzontally centered but in the top of the screen12:38
pokolicedk: and openend another time and I got in the left part of the screen :S12:38
pokolicedk: but it seems quite random to me12:38
nicoesharoonthomas: you can see the Cache object as some memoization12:41
sharoonthomasnicoe: looking into the code12:45
cedkPilou: why don't you push patch of issue3341 ?13:05
visheshWhat is Dict field? Coulnd't understand13:34
cedkvishesh: it is a dictionary13:37
visheshcedk: Can you point me to some example?13:39
cedkvishesh: the product_attribute module13:41
visheshcedk: thanks :)13:42
Piloucedk: i was busy, it's done15:15
cedkPilou: don't forget to close the issue then15:36
PilouStatus must be "resolved" or "closed" ?15:37
cedkPilou: solved15:42
cedkPilou: close is for the reporter15:42
Pilouyep i did it15:44
Pilouoh it occurs that you dit it before me, i didn't see that15:51
kotekHi. :)15:57
kotekAnyone here can neso? :>15:57
kotekI have problems with issue 350815:58
Piloucedk: 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 ?17:00
cedkPilou: it worked for me17:01
Piloui received this message from roundup-admin:
cedkPilou: of course you miss "issue"17:12
Pilouyep thanks !17:14
-!- hellhound(~hellhound@ has left #tryton17:45
motaroGood afternoon, question I want to get the first element in a Many2One field how can I do that?19:48
motaroLet me explain a little more is for an ODT report that I need pick the first entry on a Many2One field.19:53
SpartanWarriorseems strange, you need some criteria to sort the fields and pick the first20:02
motaroSpartanWarrior, I was thinking something like '<CLASS.MANY2ONEFIELD[0]>' inside the odt.20:15
motaroSpartanWarrior, 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.20:19
SpartanWarriorfrom now on I know it, thanks! :D20:20
SpartanWarriorim 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 criteria20:21
cedkmotaro: FYI, many2one as only one record so I gues you are talking about one2many20:32
cedkmotaro: then just record.one2many[0] pick the first20:32
motarook thanks cedk20:43
plantianis 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 library21:33
plantianand by "this", i mean the ServerProxy in that file21:34
SpartanWarrioryes, you can21:37
SpartanWarriorin fact, the gtk client uses rpc to 'talk' with trytond21:37
plantianSpartanWarrior: but it seems that it needs a custom json rpc proxy, will any other one work?  ie. ?21:38
SpartanWarriorNope, you can specify the port trytond will listen to the rpc calls21:44
SpartanWarriorif you can use the gtk client with trytond it's already listenting21:44
SpartanWarriortrytond haves a builtin rpc server, you don't need anything else to connect with it21:46
plantianSpartanWarrior: I need an rpc client library, the proxy class, to connect to the rpc server programmatically.21:47
plantianSpartanWarrior: 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.21:48
SpartanWarriorah! you can use python's standard xmlrpclib21:48
plantianSpartanWarrior: 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?21:50
plantianThe server proxy is extended as well as the transport.21:50
SpartanWarriorit 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...21:55

Generated by 2.11.0 by Marius Gedminas - find it at!