IRC logs of #tryton for Thursday, 2013-08-22

chat.freenode.net #tryton log beginning Thu Aug 22 00:00:02 CEST 2013
2013-08-22 00:10 <jerojasro> hi all. I have a problem with trytond detecting new modules; I installed both trytond and the trytond_account modules via pip, but the new module (account) doesn't show up in the module list that the client (tryton) shows to me
2013-08-22 00:11 <jerojasro> restarting trytond doesn't make any difference
2013-08-22 00:12 <jerojasro> however, right after connecting with the client, the trytond log shows the following:
2013-08-22 00:12 <jerojasro> [Wed Aug 21 22:09:37 2013] INFO:modules:account:registering classes
2013-08-22 00:12 <jerojasro> but I still don't get an up-to-date module list
2013-08-22 00:12 <jerojasro> any hints on what might I be doing wrong?
2013-08-22 00:23 <jerojasro> I've noticed the --init=all option in trytond, and after issuing a trytond -c ... -d mydatabase --init=all the modules do appear
2013-08-22 00:24 <jerojasro> but, am I expected to do that each time I install a new module?
2013-08-22 00:40 <sisalp2> jerojasro: which version ?
2013-08-22 00:41 <sisalp2> jerojasro: there was a bug about this. Updating any module by any means solved the problem
2013-08-22 00:41 <sisalp2> jerojasro: may still be there
2013-08-22 02:49 <jerojasro> sisalp2: 2.8
2013-08-22 02:49 <jerojasro> tryton and trytond 2.8, account 2.8.1
2013-08-22 02:51 <jerojasro> sisalp2: also, what do you mean by "Updating" ? pip install -U ? --force-reinstall ?
2013-08-22 09:19 -!- priyankarani(~priyanka@122.177.253.238) has left #tryton
2013-08-22 10:53 -!- dfr(~damienfra@01012313.cism.ucl.ac.be) has left #tryton
2013-08-22 14:52 <ready> liebe mitchatter von puls.. danke für die freundschaft zuihm... sein pc wird heute abend für immer off gehen. hagen ist vor zwei wochen leider verstorben :(
2013-08-22 17:56 <jvblasco> Is there any way to iterate all model registers without doing a search for every posible register in the table? something like "carriers = Pool().get('carrier'); for carrier in carriers:"
2013-08-22 17:59 <pokoli> jvblasco: carriers = Pool().get('carrier').search([])
2013-08-22 18:01 <jvblasco> pokoli: Thnx
2013-08-22 18:56 <jvblasco> pokoli: I guess from your statement that "carriers = cls.search([])" would return the list of all carriers records, wouldn't it?
2013-08-22 18:57 <pokoli> jvblasco: yes if cls it's an instance of carrier model
2013-08-22 18:57 <pokoli> jvblasco: can I ask for the use case?
2013-08-22 18:58 <jvblasco> pokoli: cause i always get the same error when executing it: http://pastebin.com/i8puugdu
2013-08-22 18:59 <jvblasco> pokoli: im trying to search for all carriers that are available for a delivery. I need to ask the backend b4 making any decission in my customer e-commerce platform
2013-08-22 19:00 <pokoli> jvblasco: so why you don't have a available field and filter by this field?
2013-08-22 19:00 <pokoli> jvblasco: for the traceback the code of modules/carrier_grid/carrier.py", line 79, in get_available_carriers would be usefull to help :P
2013-08-22 19:00 <jvblasco> pokoli: cause i need to calculate if the carrier can make the delivery for a received postal code
2013-08-22 19:01 <jvblasco> pokoli: yeah, that's the method i'm trying to implement.
2013-08-22 19:01 <pokoli> jvblasco: would you mind pasting the code of the function to another pastebin?
2013-08-22 19:02 <jvblasco> pokoli: sure http://pastebin.com/w8GbQPMs
2013-08-22 19:03 <jvblasco> pokoli: check_available right now returns true for each call
2013-08-22 19:05 <pokoli> jvblasco: how you are calling it, directly from rpc?
2013-08-22 19:05 <jvblasco> yup
2013-08-22 19:06 <jvblasco> pokoli: they are methods intended to accessed from my customers e-commerce modules
2013-08-22 19:06 <jvblasco> pokoli: intended to be*
2013-08-22 19:08 <jvblasco> pokoli: I assumed that calling a method from the rpc interface wouldn't change the behaviour
2013-08-22 19:09 -!- vcardon(~vcardon@LNeuilly-152-23-15-185.w193-252.abo.wanadoo.fr) has left #tryton
2013-08-22 19:11 <pokoli> jvblasco: I cannot ensure it as I don't know, have you tried calling it from inside tryton platform?
2013-08-22 19:12 <jvblasco> pokoli: nope
2013-08-22 19:12 <pokoli> jvblasco: I can not see anything strange in the code
2013-08-22 19:13 <pokoli> jvblasco: maybe something with nested transactions, are you starting a new transaction?
2013-08-22 19:13 <jvblasco> pokoli: i think it's a context issue cause cache_ctx = context.copy() is the last one in the stack trace
2013-08-22 19:14 <jvblasco> pokoli: but i need to provide the context when i make the call in the remote code
2013-08-22 19:14 <jvblasco> gimme a sec to generate the paste bin
2013-08-22 19:14 <pokoli> jvblasco: calling it from php?
2013-08-22 19:14 <pokoli> jvblasco: I think that the issue is on the context initialitzation, as context is a list and must be a dict
2013-08-22 19:15 <jvblasco> http://pastebin.com/2F2uaXFb
2013-08-22 19:15 <jvblasco> that's the php code which i'm using to make the call
2013-08-22 19:16 <pokoli> jvblasco: $context is an associative array?
2013-08-22 19:16 <pokoli> jvblasco: see previous comment
2013-08-22 19:16 <jvblasco> pokoli: yeah
2013-08-22 19:16 <jvblasco> pokoli: in fact http://pastebin.com/gNeXs07p this is what i can see in the server debug
2013-08-22 19:18 <jvblasco> pokoli: i mean those are the params the server is receiving in the RPC call
2013-08-22 19:18 <pokoli> jvblasco: I understood. One moment I will validate if context is correct :P
2013-08-22 19:20 <pokoli> jvblasco: if you fix the context is not correct, as you have a list, then the context inside, and another empty context
2013-08-22 19:21 <jvblasco> pokoli: what do u mean?
2013-08-22 19:21 <pokoli> jvblasco: that's what i seee directly from the client http://pastebin.com/kBanQUZ7
2013-08-22 19:21 <pokoli> jvblasco: i'm printing the context on the same line you have the error
2013-08-22 19:21 <pokoli> jvblasco: the important part is the ( starting your context
2013-08-22 19:22 <pokoli> jvblasco: and this part on the end , [46025]) {}
2013-08-22 19:22 <jvblasco> pokoli: so the server thinks 46025 is part of the context too?
2013-08-22 19:23 <pokoli> jvblasco: you're passing the context and another array with 46025 in it
2013-08-22 19:23 <pokoli> jvblasco: ahh I see 46025 is the postal code no? So the problem is with the postal code
2013-08-22 19:24 <pokoli> jvblasco: in line 19 you have a TRUE param you don't have in the second request. May be this is the problem
2013-08-22 19:24 <jvblasco> pokoli: gimme a sec to try
2013-08-22 19:50 <jvblasco> pokoli: solved. The problem was that the context is the last parameter u need to pass through a RPC call, or so it seems
2013-08-22 19:50 <jvblasco> pokoli: $request = $connection->sendRequest('model.carrier.get_available_carriers', array($uid, $token, array(46025), $context)); solved everything. Note that $context is now the last parameter.
2013-08-22 21:57 <plantian> Will proteus behave the same if used with just xmlrpc instead of with trytond as a module?
2013-08-22 21:58 <cedk> plantian: normally
2013-08-22 22:01 <cjbarnes18> hi cedk, could you tell me what I have missed on 92001? Maybe I have used the incorrect terminology?
2013-08-22 22:03 <cedk> cjbarnes18: I don't understand
2013-08-22 22:05 <cjbarnes18> cedk: on issue 92001 Add wsgi protocol, I have use wrapper code (maybe this shaould be called a factory function) to provide the jsonrpc_app, you suggested this was wrong
2013-08-22 22:06 <cedk> cjbarnes18: I think it is not a nice design
2013-08-22 22:06 <cjbarnes18> ok, great.
2013-08-22 22:07 <cedk> cjbarnes18: probably a callable class is better
2013-08-22 22:07 <cjbarnes18> ok, I was considering that anyway.
2013-08-22 22:08 <cedk> cjbarnes18: and probably it should be singleton with error if instanciated many times
2013-08-22 22:09 <cedk> cjbarnes18: and to be complete it must support the GET method for sao
2013-08-22 22:10 <cjbarnes18> I have been looking at GET, not sure where to start yet.
2013-08-22 22:10 <cjbarnes18> why a singleton?
2013-08-22 22:12 <cjbarnes18> for multiprocess I guess singlton would not be a problem tho...
2013-08-22 22:16 <cjbarnes18> ACTION pings cedk
2013-08-22 22:43 <cedk> cjbarnes18: because pool can not be started more than once
2013-08-22 22:43 <cedk> cjbarnes18: and configuration is also global
2013-08-22 23:13 <cjbarnes18> cedk: ok, I will work to these designs, thank you very much for your time.

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!