IRC logs of #tryton for Monday, 2013-03-04

chat.freenode.net #tryton log beginning Mon Mar 4 00:00:03 CET 2013
ozmeisterHello everybody. I'm trying to setup a dev environment for tryton and GNU Health. I'm using a virtualenv.02:39
ozmeisterWith the virtualenv deactivated, the Tryton client launches fine02:39
ozmeisterbut with the env activated, i get "ImportError: No module named pygtk"02:40
ozmeisteranyone have any pointers?02:40
plantianozmeister: yeah i have seen that before02:51
plantianozmeister: virtualenv now defaults to no site packages but pygtk usually only works with your distro's site package because of some c extensions02:51
plantianozmeister: I have to allow site packages with the client ve otherwise I get that error.02:52
ozmeisterI see...I found something on stackoverflow that involves creating symlinks between the virtualenv site-packages folder and the global dist-packages folder02:53
ozmeisterbut now I get "No moduled named gobject" :)02:54
plantianozmeister: I think you might need to use the  --system-site-packages flag when creating your virtualenv.02:54
ozmeisterok...so I should delete the virtualenv I'm using now?02:55
plantianozmeister: I'm not sure, you might be able to just run virtualenv over the same directory again with different flags, like virtualenv ...FLAGS... ve02:56
plantianozmeister: You can just re-install everything again though if you delete it.02:57
ozmeisterOk, I'll try that in a few minutes. Meanwhile, is there a current 'best practices' way of setting up a tryton dev environment?02:57
plantianozmeister: There are some notes on the wiki, is that what you are following?02:58
plantianhttp://code.google.com/p/tryton/wiki/InstallationMercurial02:59
ozmeisterI see...and after cloning the repos, I can just hg checkout the 2.6.0 branch?03:01
plantianozmeister: actually each major version has its own repo and changes are back ported from trunk to each applicable major version03:09
plantianozmeister: ie. http://hg.tryton.org/2.6/trytond/ is for 2.6 trytond server and http://hg.tryton.org/trytond/ is for the trunk version of the trytond server03:10
ozmeisterplantian: Yes, I just realized that. I'm cloning the client now...Is the use of hgnested still recommended to clone the server and modules?03:14
plantianozmeister: Yeah as far as I know hgnested still is recommended.  So to be more specific if you are developing to target the 2.6 branch you should change the commands: hg clone http://hg.tryton.org/tryton/ and hg nclone http://hg.tryton.org/trytond/ TO BE hg clone http://hg.tryton.org/2.6/tryton/ and hg nclone http://hg.tryton.org/2.6/trytond/03:17
ozmeisterplantian: Thanks a bunch. Was having some problems with hgnested, but remembered that I have to enable it in my .hgrc :)03:23
plantianozmeister: You can pass it on the command line as well if hgrc does not work for you.03:24
plantianHa although maybe that is more pain than it is worth.03:25
ozmeisterplantian: :) I'll try that next time03:25
ozmeister...now I've got a night of module development ahead of me :)03:26
plantianozmeister: okay good luck, is this going to be your first time writing modules and/or using tryton?03:28
ozmeisterYes to both...I just started using GNU Health 3 weeks ago, and want to extend it's functionality a bit...any tips?03:30
plantianozmeister: The documentation has improved a lot but the official modules are still the best reference for HOWTO type examples.03:32
plantianozmeister: And the usual tip but always forgotten, start as small as possible.03:33
ozmeisterplantian: oh yeah, smart small...we always seem to get caught by that one :)03:36
plantiandevelopers, we never learn03:38
ozmeisterand think we're smarter than everyone else :)03:39
ozmeisterI think I'll start with the sample module on the wiki...just to get my feet wet03:42
ozmeisterIt looks like it's a bit outdated though...it refers to __tryton__.py instead of tryton.cfg03:44
plantianozmeister: yeah its not clear how to handle it, I was talking to someone about it the other day, i think something like it should be rolled into the official docs because the wiki always lags behind the releases03:56
plantianozmeister: there are tips in the comments on it, but otherwise probably better to cross reference with a simple official module03:57
ozmeisterplantian: Will do. I've gotten the repos cloned and the client and server running. However, when I try to create the database, I get "Could not connect to the server"04:11
ozmeisterserver console output is showing "INFO: database:connect to "template1"04:12
plantianozmeister: Are you using postgresql ?04:13
ozmeisteryup, and I've verified that its running04:13
plantianozmeister: I think you probably have to create a database in it as well.04:13
plantianozmeister: Actually that is what I do, you can create it with the client as well.04:14
plantianWhen does that message show?04:14
ozmeisterlemme guess: because I'm running from source as opposed installing via pip?04:14
ozmeisterlemme check04:14
ozmeisterIt shows in the Profile Editor after you enter the hostname...whn you would normally see a progress bar04:16
plantianozmeister: oh i see, did you start the server process before launching the client?04:20
ozmeisterplantian: Yes, i started it before04:21
ozmeisterplantian: Something tells me that it's because I didn't create a system user named "gnuhealth" (as per GNU Health install doc)04:21
plantianozmeister: Hmm yeah I don't know anything about gnuhealth.  I use only tryton.04:26
ozmeisteryeah gnuhealth is basically some tryton modules focused on healthcare providers04:34
ozmeisterI have a vm with a system user 'gnuhealth'..I'll fire it up and see what happens04:35
plantianozmeister: When you try to connect with the client that is when you server spouts that info message? "INFO: database:connect to "template1"04:35
ozmeisterplantian: Haven't reached the connection stage yet...It's when you open the profile editor to add a new connection 'localhost'04:39
ozmeisterso I add the name 'localhost' and also add 'localhost' as the hostname of the server. Normally, when you click in the port field, a progress bar would appear and then a button labelled "Create database"04:40
plantianozmeister: This is the gnu health client or the regular tryton client?05:17
plantianOh I see, I never use profiles.  That seems like it probably either the wrong port of trytond is not running.05:18
ozmeisterplantian: It's the regular tryton client05:18
plantianozmeister: When you start trytond what does the line that looks like this line say?: [Sun Mar 03 22:12:22 2013] INFO:server:starting JSON-RPC protocol on localhost:800005:19
ozmeisterplantian: Yup, exactly that05:20
plantianozmeister: Maybe there is more information here -- http://code.google.com/p/tryton/wiki/SetupAndStart  -- What if you close the Login pop-up and go to File >  Database > New Database in the menu and try to create a new db?05:25
ozmeisterplantian: Good tip. It seems I was right: "Error creating database!...role 'ozmeister' does not exist05:34
ozmeisterso it's passing my system login name to postgres. There's no postgres role in my name05:34
plantianozmeister: Yeah I'm not 100% clear on that part.  I think I have set a admin_passwd and db_user in the trytond.conf file and the db_user I have set has password-less access on localhost via my postgresql setup.  I forget the details though.  Maybe just try to follow the setup and start directions and see if that works out.05:39
ozmeisterplantian: Just tried on my VM with login name 'gnuhealth', with a corresponding postgres role.. working now :)05:39
plantianozmeister: awesome05:39
ozmeisteroops...spoke too soon... while creating the database..."No module named pywebdav.lib"05:40
ozmeisterthink I've seen this one before...05:41
ozmeisterplantian: solved that one by removing existing pywebdav and reinstalling via pip within virtualenv05:56
plantianozmeister: yeah ha good thing you have seen that, i have not seen pywebdav in a while05:57
ozmeisterplantian: Yeah, it bit me the first time i tried installng tryton05:59
iamnoobhi good day. is the tutorial on the Hello World , the report part, will it still work on 2.6?06:05
ozmeisteriamnoob: I'm not sure, I'm actually gearing up to go through that tutorial in the next few hours :)06:06
iamnoob@ozmeister ok :) ill try to use the old tutorial. ill see what happen later on06:22
iamnoobhi again, im having an error--> ('Error', Wrong field name (*some field*) for *some modelname* in order!')   why do this error come up? how do i fix this please07:32
iamnoobmy module used to work, but after i add up some new fields.char this starts to happen07:36
-!- plantian(~ian@174.134.200.53) has left #tryton09:26
iamnoobany good example on creating a report? i tried doing the report tuts but the report button is still un clickable09:29
plantianiamnoob: Did you follow these docs: http://doc.tryton.org/2.6/trytond/doc/topics/reports/index.html ?09:31
iamnoobplantian: hi there, soo the new thing i need to do in 2.6 is first install relatorio?09:37
iamnoobdoes the <field name="style>company/header_A4.odt<field>    required in order to make a report?10:02
plantianiamnoob: I think you always needed relatorio.10:08
GiceHey, I'm trying to log all the queries and result-sets sent by tryton to the (postgresql) database. I've been trying to do this in the backed/postgres/database.py file. But if I fetch the data from the result-set, it's gone (the program can't fetchall it again, right). Does anyone know how to circumvent this problem?10:09
plantianiamnoob: I'm not sure the rules of the path.  Are you trying to over write a specific report?10:11
corroiamnoob: The style field is not required. In fact, I don't think you should use it anymore, iirc it will be dropped sooner or later.10:13
iamnoobplantian: no i just saw it on account_invoice.xml, actually im trying to create from scratches10:14
iamnoobcorro: ohh,, thank for the heads up10:18
iamnoobplantian: hi idk whats wrong with this http://pastebin.com/b7u0bJUL  after i install my module. still report is disabled, i already created the .odt file. still no good :(10:23
corroiamnoob: Have you tried logging out and in again? Changes to the toolbar, like adding a new report, unfortunately don't show up otherwise.10:27
iamnoobcorro: will try it out. i did try creating a new database and install it. still no luck10:31
rmuhi10:36
rmuis there some trick to debug errors in odts10:36
rmutracebacks in trytond --debug are unreadable. it shows what seems like binary data, probably the compressed xml in the odt10:37
corrormu: Try deleting large portions of the report until the report works again, then you have a hint of where the error might be. Afterwards you can undo the deletions again. That's how I do it mostly.10:41
GiceHi, I want to log all queries sent to the database by tryton with the corresponding result set (as well as some application information, such as the current user, timestamp etc). How should I approach this?10:48
udonoGice: hi, maybe use the postgres logging features10:49
Giceyou mean in the database rather than inside the application?10:49
udonoGice: yes, depending on the level of details you want.10:50
iamnoobcorro: still no good, i cant seem to find, whats do party module have and what my own module does not have when it comes to creating a report..  im running in circle's with this problem :(10:51
Giceudono: well, ideally I want to get as much info as possible, the user's name, the user's role, the module used, etc. I can get the query details from the database but then it gets hard to combine/merge those two logsfiles10:52
udonoGice: You can enable the client logging. Just start the client with --help to see the options.10:52
Giceokay, I'll look into that, and what would the default logging location be in that case?10:53
Giceand thank you udono :)10:53
udonoGice: stdout10:53
iamnoobanyone here have a sample working module that have a working report for ver 2.6 please. been following how party module did it. but i dont know what is wrong :(10:54
corroiamnoob: Just an idea, but: Is the xml file listed in __tryton__.py? If not, the file never gets parsed.10:55
rmucorro: on 2.6 it should be tryton.cfg, not __tryton__.py10:56
udonoiamnoob: ...and did you update the database.10:56
corrormu: ah, just saw he's working with 2.6.10:56
rmuGice: have a look at trytond/backend/postgresql/database.py, class Cursor10:57
iamnoobcorro: yes i did put it up on the tryton.cfg file as xml:10:57
jcaviamnoob: Does uprline inherit from Report ?10:58
iamnoobudono: ok ill try to update the database.. even though its a fresh new database10:58
rmuiamnoob: if you change xml-files you need to update the databases that use the model that contains the modified xml-file10:59
iamnoobjcav: sorry i cant seem to understand what you said..  upr.uprline is a model inside Unit_Procurement_Request.py11:00
rmus/model/module/11:00
jcaviamnoob: the model field of the ir.action.report must be a class which inherits from Report11:01
Gicermu: I looked at it, but if I fetchall the result set in my logger module, the application can't do it anymore. is there a way to get the data without 'using' it?11:02
jcaviamnoob: what I mean is that the value of the report_name of your ir.action.report must be the __name__ of a model which inherits from Report11:04
jcaviamnoob: Look the SaleReport class of the sale/sale.py file11:05
rmuGice: you want to log the complete resultset, even if the application doesn't fetch it?11:08
iamnoobjcav: thanks will work on it, yes the report_name was what my moduel's _name_ is,11:08
jcaviamnoob: If you do not need a special behaviour, I think you might only override Report or CompanReport and give it a __name__11:10
Gicermu: Hmm, good question. In essence I would like to see what information a users requests, and what is shown to him/her. And I supposed the application tries to query exactly the data it needs, although that's only an assumption. That's why I want to look at the entire resultset..11:10
rmuGice: why don't you log it on the fly, when it is fetched11:12
rmuGice: logging each and every sql query including all results will produce _huge_ logfiles!11:13
Gicermu: yeah I noticed that -,- (filesize), So I probably won't log some types of queries (for example, only reads, no creates or updates). Wouldn't logging it as it's fetched be difficult to implement since it happens where ever its needed (read: all over the place)?11:16
Gicermu: besides, does logging it as its needed give me the full query?11:16
iamnoobjcav: does the report part on this http://code.google.com/p/tryton/wiki/HelloWorld still work on 2.6? cause im getting confused where did it get on the report_name = hello.helloworld, when _name_ = hello.hello11:20
iamnoobjcav: i mean.. its report_name = hello.helloworld, when the class model _name_ = hello.hello11:21
jcaviamnoob: Yeah, I think it should not work properly11:23
cedkiamnoob: use the training module: http://hg.tryton.org/2.6/training11:23
rmuGice: don't understand. the facility to log the queries is already there, it only has to be activated. logging results should also be easy, look at _Cursor.11:26

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!