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

chat.freenode.net #tryton log beginning Mon Mar 4 00:00:03 CET 2013
2013-03-04 02:39 <ozmeister> Hello everybody. I'm trying to setup a dev environment for tryton and GNU Health. I'm using a virtualenv.
2013-03-04 02:39 <ozmeister> With the virtualenv deactivated, the Tryton client launches fine
2013-03-04 02:40 <ozmeister> but with the env activated, i get "ImportError: No module named pygtk"
2013-03-04 02:40 <ozmeister> anyone have any pointers?
2013-03-04 02:51 <plantian> ozmeister: yeah i have seen that before
2013-03-04 02:51 <plantian> ozmeister: virtualenv now defaults to no site packages but pygtk usually only works with your distro's site package because of some c extensions
2013-03-04 02:52 <plantian> ozmeister: I have to allow site packages with the client ve otherwise I get that error.
2013-03-04 02:53 <ozmeister> I see...I found something on stackoverflow that involves creating symlinks between the virtualenv site-packages folder and the global dist-packages folder
2013-03-04 02:54 <ozmeister> but now I get "No moduled named gobject" :)
2013-03-04 02:54 <plantian> ozmeister: I think you might need to use the --system-site-packages flag when creating your virtualenv.
2013-03-04 02:55 <ozmeister> ok...so I should delete the virtualenv I'm using now?
2013-03-04 02:56 <plantian> ozmeister: I'm not sure, you might be able to just run virtualenv over the same directory again with different flags, like virtualenv ...FLAGS... ve
2013-03-04 02:57 <plantian> ozmeister: You can just re-install everything again though if you delete it.
2013-03-04 02:57 <ozmeister> Ok, I'll try that in a few minutes. Meanwhile, is there a current 'best practices' way of setting up a tryton dev environment?
2013-03-04 02:58 <plantian> ozmeister: There are some notes on the wiki, is that what you are following?
2013-03-04 02:59 <plantian> http://code.google.com/p/tryton/wiki/InstallationMercurial
2013-03-04 03:01 <ozmeister> I see...and after cloning the repos, I can just hg checkout the 2.6.0 branch?
2013-03-04 03:09 <plantian> ozmeister: actually each major version has its own repo and changes are back ported from trunk to each applicable major version
2013-03-04 03:10 <plantian> ozmeister: 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 server
2013-03-04 03:14 <ozmeister> plantian: Yes, I just realized that. I'm cloning the client now...Is the use of hgnested still recommended to clone the server and modules?
2013-03-04 03:17 <plantian> ozmeister: 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/
2013-03-04 03:23 <ozmeister> plantian: Thanks a bunch. Was having some problems with hgnested, but remembered that I have to enable it in my .hgrc :)
2013-03-04 03:24 <plantian> ozmeister: You can pass it on the command line as well if hgrc does not work for you.
2013-03-04 03:25 <plantian> Ha although maybe that is more pain than it is worth.
2013-03-04 03:25 <ozmeister> plantian: :) I'll try that next time
2013-03-04 03:26 <ozmeister> ...now I've got a night of module development ahead of me :)
2013-03-04 03:28 <plantian> ozmeister: okay good luck, is this going to be your first time writing modules and/or using tryton?
2013-03-04 03:30 <ozmeister> Yes to both...I just started using GNU Health 3 weeks ago, and want to extend it's functionality a bit...any tips?
2013-03-04 03:32 <plantian> ozmeister: The documentation has improved a lot but the official modules are still the best reference for HOWTO type examples.
2013-03-04 03:33 <plantian> ozmeister: And the usual tip but always forgotten, start as small as possible.
2013-03-04 03:36 <ozmeister> plantian: oh yeah, smart small...we always seem to get caught by that one :)
2013-03-04 03:38 <plantian> developers, we never learn
2013-03-04 03:39 <ozmeister> and think we're smarter than everyone else :)
2013-03-04 03:42 <ozmeister> I think I'll start with the sample module on the wiki...just to get my feet wet
2013-03-04 03:44 <ozmeister> It looks like it's a bit outdated though...it refers to __tryton__.py instead of tryton.cfg
2013-03-04 03:56 <plantian> ozmeister: 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 releases
2013-03-04 03:57 <plantian> ozmeister: there are tips in the comments on it, but otherwise probably better to cross reference with a simple official module
2013-03-04 04:11 <ozmeister> plantian: 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"
2013-03-04 04:12 <ozmeister> server console output is showing "INFO: database:connect to "template1"
2013-03-04 04:13 <plantian> ozmeister: Are you using postgresql ?
2013-03-04 04:13 <ozmeister> yup, and I've verified that its running
2013-03-04 04:13 <plantian> ozmeister: I think you probably have to create a database in it as well.
2013-03-04 04:14 <plantian> ozmeister: Actually that is what I do, you can create it with the client as well.
2013-03-04 04:14 <plantian> When does that message show?
2013-03-04 04:14 <ozmeister> lemme guess: because I'm running from source as opposed installing via pip?
2013-03-04 04:14 <ozmeister> lemme check
2013-03-04 04:16 <ozmeister> It shows in the Profile Editor after you enter the hostname...whn you would normally see a progress bar
2013-03-04 04:20 <plantian> ozmeister: oh i see, did you start the server process before launching the client?
2013-03-04 04:21 <ozmeister> plantian: Yes, i started it before
2013-03-04 04:21 <ozmeister> plantian: Something tells me that it's because I didn't create a system user named "gnuhealth" (as per GNU Health install doc)
2013-03-04 04:26 <plantian> ozmeister: Hmm yeah I don't know anything about gnuhealth. I use only tryton.
2013-03-04 04:34 <ozmeister> yeah gnuhealth is basically some tryton modules focused on healthcare providers
2013-03-04 04:35 <ozmeister> I have a vm with a system user 'gnuhealth'..I'll fire it up and see what happens
2013-03-04 04:35 <plantian> ozmeister: When you try to connect with the client that is when you server spouts that info message? "INFO: database:connect to "template1"
2013-03-04 04:39 <ozmeister> plantian: Haven't reached the connection stage yet...It's when you open the profile editor to add a new connection 'localhost'
2013-03-04 04:40 <ozmeister> so 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"
2013-03-04 05:17 <plantian> ozmeister: This is the gnu health client or the regular tryton client?
2013-03-04 05:18 <plantian> Oh I see, I never use profiles. That seems like it probably either the wrong port of trytond is not running.
2013-03-04 05:18 <ozmeister> plantian: It's the regular tryton client
2013-03-04 05:19 <plantian> ozmeister: 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:8000
2013-03-04 05:20 <ozmeister> plantian: Yup, exactly that
2013-03-04 05:25 <plantian> ozmeister: 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?
2013-03-04 05:34 <ozmeister> plantian: Good tip. It seems I was right: "Error creating database!...role 'ozmeister' does not exist
2013-03-04 05:34 <ozmeister> so it's passing my system login name to postgres. There's no postgres role in my name
2013-03-04 05:39 <plantian> ozmeister: 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.
2013-03-04 05:39 <ozmeister> plantian: Just tried on my VM with login name 'gnuhealth', with a corresponding postgres role.. working now :)
2013-03-04 05:39 <plantian> ozmeister: awesome
2013-03-04 05:40 <ozmeister> oops...spoke too soon... while creating the database..."No module named pywebdav.lib"
2013-03-04 05:41 <ozmeister> think I've seen this one before...
2013-03-04 05:56 <ozmeister> plantian: solved that one by removing existing pywebdav and reinstalling via pip within virtualenv
2013-03-04 05:57 <plantian> ozmeister: yeah ha good thing you have seen that, i have not seen pywebdav in a while
2013-03-04 05:59 <ozmeister> plantian: Yeah, it bit me the first time i tried installng tryton
2013-03-04 06:05 <iamnoob> hi good day. is the tutorial on the Hello World , the report part, will it still work on 2.6?
2013-03-04 06:06 <ozmeister> iamnoob: I'm not sure, I'm actually gearing up to go through that tutorial in the next few hours :)
2013-03-04 06:22 <iamnoob> @ozmeister ok :) ill try to use the old tutorial. ill see what happen later on
2013-03-04 07:32 <iamnoob> hi 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 please
2013-03-04 07:36 <iamnoob> my module used to work, but after i add up some new fields.char this starts to happen
2013-03-04 09:26 -!- plantian(~ian@174.134.200.53) has left #tryton
2013-03-04 09:29 <iamnoob> any good example on creating a report? i tried doing the report tuts but the report button is still un clickable
2013-03-04 09:31 <plantian> iamnoob: Did you follow these docs: http://doc.tryton.org/2.6/trytond/doc/topics/reports/index.html ?
2013-03-04 09:37 <iamnoob> plantian: hi there, soo the new thing i need to do in 2.6 is first install relatorio?
2013-03-04 10:02 <iamnoob> does the <field name="style>company/header_A4.odt<field> required in order to make a report?
2013-03-04 10:08 <plantian> iamnoob: I think you always needed relatorio.
2013-03-04 10:09 <Gice> Hey, 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?
2013-03-04 10:11 <plantian> iamnoob: I'm not sure the rules of the path. Are you trying to over write a specific report?
2013-03-04 10:13 <corro> iamnoob: 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.
2013-03-04 10:14 <iamnoob> plantian: no i just saw it on account_invoice.xml, actually im trying to create from scratches
2013-03-04 10:18 <iamnoob> corro: ohh,, thank for the heads up
2013-03-04 10:23 <iamnoob> plantian: 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 :(
2013-03-04 10:27 <corro> iamnoob: Have you tried logging out and in again? Changes to the toolbar, like adding a new report, unfortunately don't show up otherwise.
2013-03-04 10:31 <iamnoob> corro: will try it out. i did try creating a new database and install it. still no luck
2013-03-04 10:36 <rmu> hi
2013-03-04 10:36 <rmu> is there some trick to debug errors in odts
2013-03-04 10:37 <rmu> tracebacks in trytond --debug are unreadable. it shows what seems like binary data, probably the compressed xml in the odt
2013-03-04 10:41 <corro> rmu: 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.
2013-03-04 10:48 <Gice> Hi, 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?
2013-03-04 10:49 <udono> Gice: hi, maybe use the postgres logging features
2013-03-04 10:49 <Gice> you mean in the database rather than inside the application?
2013-03-04 10:50 <udono> Gice: yes, depending on the level of details you want.
2013-03-04 10:51 <iamnoob> corro: 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 :(
2013-03-04 10:52 <Gice> udono: 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 logsfiles
2013-03-04 10:52 <udono> Gice: You can enable the client logging. Just start the client with --help to see the options.
2013-03-04 10:53 <Gice> okay, I'll look into that, and what would the default logging location be in that case?
2013-03-04 10:53 <Gice> and thank you udono :)
2013-03-04 10:53 <udono> Gice: stdout
2013-03-04 10:54 <iamnoob> anyone 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 :(
2013-03-04 10:55 <corro> iamnoob: Just an idea, but: Is the xml file listed in __tryton__.py? If not, the file never gets parsed.
2013-03-04 10:56 <rmu> corro: on 2.6 it should be tryton.cfg, not __tryton__.py
2013-03-04 10:56 <udono> iamnoob: ...and did you update the database.
2013-03-04 10:56 <corro> rmu: ah, just saw he's working with 2.6.
2013-03-04 10:57 <rmu> Gice: have a look at trytond/backend/postgresql/database.py, class Cursor
2013-03-04 10:57 <iamnoob> corro: yes i did put it up on the tryton.cfg file as xml:
2013-03-04 10:58 <jcav> iamnoob: Does uprline inherit from Report ?
2013-03-04 10:58 <iamnoob> udono: ok ill try to update the database.. even though its a fresh new database
2013-03-04 10:59 <rmu> iamnoob: if you change xml-files you need to update the databases that use the model that contains the modified xml-file
2013-03-04 11:00 <iamnoob> jcav: sorry i cant seem to understand what you said.. upr.uprline is a model inside Unit_Procurement_Request.py
2013-03-04 11:00 <rmu> s/model/module/
2013-03-04 11:01 <jcav> iamnoob: the model field of the ir.action.report must be a class which inherits from Report
2013-03-04 11:02 <Gice> rmu: 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?
2013-03-04 11:04 <jcav> iamnoob: 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 Report
2013-03-04 11:05 <jcav> iamnoob: Look the SaleReport class of the sale/sale.py file
2013-03-04 11:08 <rmu> Gice: you want to log the complete resultset, even if the application doesn't fetch it?
2013-03-04 11:08 <iamnoob> jcav: thanks will work on it, yes the report_name was what my moduel's _name_ is,
2013-03-04 11:10 <jcav> iamnoob: If you do not need a special behaviour, I think you might only override Report or CompanReport and give it a __name__
2013-03-04 11:10 <Gice> rmu: 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..
2013-03-04 11:12 <rmu> Gice: why don't you log it on the fly, when it is fetched
2013-03-04 11:13 <rmu> Gice: logging each and every sql query including all results will produce _huge_ logfiles!
2013-03-04 11:16 <Gice> rmu: 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)?
2013-03-04 11:16 <Gice> rmu: besides, does logging it as its needed give me the full query?
2013-03-04 11:20 <iamnoob> jcav: 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.hello
2013-03-04 11:21 <iamnoob> jcav: i mean.. its report_name = hello.helloworld, when the class model _name_ = hello.hello
2013-03-04 11:23 <jcav> iamnoob: Yeah, I think it should not work properly
2013-03-04 11:23 <cedk> iamnoob: use the training module: http://hg.tryton.org/2.6/training
2013-03-04 11:26 <rmu> Gice: 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.

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